在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);}
------解决方案--------------------