Java 获取错误使用apache http核心和http客户端库时,无法访问org.apache.http.HttpResponse类型

Java 获取错误使用apache http核心和http客户端库时,无法访问org.apache.http.HttpResponse类型,java,eclipse,http,Java,Eclipse,Http,我正在尝试导入httpclient、string实体类和前面提到的所有其他类,但是没有一个类被导入。我已经将jar文件添加到构建路径中,但似乎没有任何东西可以解决这些错误。有人能帮我解决吗。我坚持了差不多一天了 package httpRequests; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.Http

我正在尝试导入httpclient、string实体类和前面提到的所有其他类,但是没有一个类被导入。我已经将jar文件添加到构建路径中,但似乎没有任何东西可以解决这些错误。有人能帮我解决吗。我坚持了差不多一天了

package httpRequests;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;

public class http {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        String IP = "api.cle.org.pk";
        String postURL = "https://" + IP+ "/v1/synth";
        HttpClient   httpClient    = HttpClientBuilder.create().build();
        HttpPost     post          = new HttpPost(postURL);
        StringEntity postingString = new StringEntity(JSON_MSG,"UTF-8");
        post.setEntity(postingString);
        post.setHeader("Content-type", "application/json;odata=verbose");
        HttpResponse response = httpClient.execute(post);
        String JSON_Response=convertStreamToString(response.getEntity().getContent());
                    
    }

}


您使用的是什么Eclipse版本,您使用的是什么Java版本?@Abra Java 13.0.2 2020-01-14 Java(TM)SE运行时环境(build 13.0.2+8)Eclipse版本:2020-06(4.16.0)您查看了问题视图吗?从Eclipse菜单:窗口>显示视图>问题