无法实例化类型HttpClient [英] Cannot instantiate the type HttpClient
本文介绍了无法实例化类型HttpClient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是一个编译器时间错误。我不会让我实例化它。
我正在导入正确的库,而不是太阳版本,并使用默认的引用,由他们的教程
HttpClient client = new HttpClient(); ($,
$ / pre $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ a a a a a a a a a a a a a a a a a a a a a a href =http://hc.apache.org/downloads.cgi =nofollow noreferrer> here )解决方案 HttpClient
是4.x中的一个接口,对于实例使用 DefaultHttpClient
HttpClient httpclient = new DefaultHttpClient();
I have added the .jars to my library and I can also instantiate other classes in the JAR. What gives? I've tried to clean the project etc.
It's a compiler-time error. Eclipse won't let me instantiate it.
I'm importing the correct library, not the sun version, and using the default contructor, specified by their tutorial
HttpClient client = new HttpClient();
(Eclipse, mac, Apache HTTP, "HttpClient 4.0.1 (GA)" downloaded from here)
解决方案 HttpClient
is an interface in 4.x, use DefaultHttpClient
for instances.
HttpClient httpclient = new DefaultHttpClient();
这篇关于无法实例化类型HttpClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文