当前位置: 代码迷 >> Eclipse >> Cannot instantiate the type HttpClient解决方案
  详细解决方案

Cannot instantiate the type HttpClient解决方案

热度:76   发布时间:2016-04-23 13:33:22.0
Cannot instantiate the type HttpClient
在CLASS PATH中添加了HttpClient需要的三个jar,并没有用,import依然报错
后来通过工程属性导入之后,import不报错了,但是
依然提示Cannot instantiate the type HttpClient
Java code
import org.apache.http.client.*;import org.apache.http.client.methods.*;import org.apache.http.client.params.*;import java.io.*;public class HttpTwoA {      private static String url = "http://www.apache.org/";      public static void main(String[] args) {        // Create an instance of HttpClient.        HttpClient client = new HttpClient();        // Create a method instance.        GetMethod method = new GetMethod(url);}    


------解决方案--------------------
探讨
在CLASS PATH中添加了HttpClient需要的三个jar,并没有用,import依然报错
后来通过工程属性导入之后,import不报错了,但是
依然提示Cannot instantiate the type HttpClient
Java code
import org.apache.http.client.*;
import org.apache.http.client.met……
  相关解决方案