我在哪里可以下载 org.apache.http 包的 jar?

Posted

技术标签:

【中文标题】我在哪里可以下载 org.apache.http 包的 jar?【英文标题】:Where can I download the jar for org.apache.http package? 【发布时间】:2010-12-28 06:54:05 【问题描述】:

我想要org.apache.http 包的jar 文件,但找不到,谁能告诉我从哪里下载?

即使在 Apache 站点以及 findjar.co 站点中,我也无法找到该 jar。

【问题讨论】:

【参考方案1】:

Apache HttpCore

更新了新链接

【讨论】:

我的 4.0.1 zip 数据很少,但所需的 jar org.apache.http 不存在。 你下载HttpCore了吗(HttpClient和HttpCore在同一个下载页面)?压缩文件是 httpcomponents-core-4.0.1-bin.zip。它包含具有 org.apache.http.* 类的 lib/httpcore-4.0.1.jar。 android lib 的链接已经死了,有没有替代方案?【参考方案2】:

您可以在app:Build gradle 中使用以下代码添加org.apache.http

dependencies 
    compile 'org.apache.httpcomponents:httpclient:4.5'

【讨论】:

谢谢。这真的很有帮助。【参考方案3】:

在 Maven repo 中,有一些示例可以在 maven、sbt、gradle 等中添加依赖项。

https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore/4.4.11

即对于Maven,你只需创建一个项目,例如

mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4

然后查看 pom.xml,然后查看依赖项 xml 元素处的库:

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpcore</artifactId>
    <version>4.4.11</version>
</dependency>

为 sbt 做类似的事情

sbt new scala/hello-world.g8

然后编辑 build.sbt 以添加库

libraryDependencies += "org.apache.httpcomponents" % "httpcore" % "4.4.11"

【讨论】:

【参考方案4】:

http://www.java2s.com/Code/Jar/s/Downloadservletapijar.htm

下载 servlet-api.jar 这包含以下所有文件:

META-INF/LICENSE
META-INF/MANIFEST.MF
META-INF/NOTICE
javax.servlet.Async

Context.class
javax.servlet.AsyncEvent.class
javax.servlet.AsyncListener.class
javax.servlet.DispatcherType.class
javax.servlet.Filter.class
javax.servlet.FilterChain.class
javax.servlet.FilterConfig.class
javax.servlet.FilterRegistration.class
javax.servlet.GenericServlet.class
javax.servlet.HttpConstraintElement.class
javax.servlet.HttpMethodConstraintElement.class
javax.servlet.MultipartConfigElement.class
javax.servlet.Registration.class
javax.servlet.RequestDispatcher.class
javax.servlet.Servlet.class
javax.servlet.ServletConfig.class
javax.servlet.ServletContainerInitializer.class
javax.servlet.ServletContext.class
javax.servlet.ServletContextAttributeEvent.class
javax.servlet.ServletContextAttributeListener.class
javax.servlet.ServletContextEvent.class
javax.servlet.ServletContextListener.class
javax.servlet.ServletException.class
javax.servlet.ServletInputStream.class
javax.servlet.ServletOutputStream.class
javax.servlet.ServletRegistration.class
javax.servlet.ServletRequest.class
javax.servlet.ServletRequestAttributeEvent.class
javax.servlet.ServletRequestAttributeListener.class
javax.servlet.ServletRequestEvent.class
javax.servlet.ServletRequestListener.class
javax.servlet.ServletRequestWrapper.class
javax.servlet.ServletResponse.class
javax.servlet.ServletResponseWrapper.class
javax.servlet.ServletSecurityElement.class
javax.servlet.SessionCookieConfig.class
javax.servlet.SessionTrackingMode.class
javax.servlet.SingleThreadModel.class
javax.servlet.UnavailableException.class
javax.servlet.annotation.HandlesTypes.class
javax.servlet.annotation.HttpConstraint.class
javax.servlet.annotation.HttpMethodConstraint.class
javax.servlet.annotation.MultipartConfig.class
javax.servlet.annotation.ServletSecurity.class
javax.servlet.annotation.WebFilter.class
javax.servlet.annotation.WebInitParam.class
javax.servlet.annotation.WebListener.class
javax.servlet.annotation.WebServlet.class
javax.servlet.descriptor.JspConfigDescriptor.class
javax.servlet.descriptor.JspPropertyGroupDescriptor.class
javax.servlet.descriptor.TaglibDescriptor.class
javax.servlet.http.Cookie.class
javax.servlet.http.HttpServlet.class
javax.servlet.http.HttpServletRequest.class
javax.servlet.http.HttpServletRequestWrapper.class
javax.servlet.http.HttpServletResponse.class
javax.servlet.http.HttpServletResponseWrapper.class
javax.servlet.http.HttpSession.class
javax.servlet.http.HttpSessionActivationListener.class
javax.servlet.http.HttpSessionAttributeListener.class
javax.servlet.http.HttpSessionBindingEvent.class
javax.servlet.http.HttpSessionBindingListener.class
javax.servlet.http.HttpSessionContext.class
javax.servlet.http.HttpSessionEvent.class
javax.servlet.http.HttpSessionListener.class
javax.servlet.http.HttpUtils.class
javax.servlet.http.NoBodyOutputStream.class
javax.servlet.http.NoBodyResponse.class
javax.servlet.http.Part.class
javax/servlet/LocalStrings.properties
javax/servlet/http/LocalStrings.properties
javax/servlet/resources/XMLSchema.dtd
javax/servlet/resources/datatypes.dtd
javax/servlet/resources/j2ee_1_4.xsd
javax/servlet/resources/j2ee_web_services_1_1.xsd
javax/servlet/resources/j2ee_web_services_client_1_1.xsd
javax/servlet/resources/javaee_5.xsd
javax/servlet/resources/javaee_6.xsd
javax/servlet/resources/javaee_web_services_1_2.xsd
javax/servlet/resources/javaee_web_services_1_3.xsd
javax/servlet/resources/javaee_web_services_client_1_2.xsd
javax/servlet/resources/javaee_web_services_client_1_3.xsd
javax/servlet/resources/web-app_2_2.dtd
javax/servlet/resources/web-app_2_3.dtd
javax/servlet/resources/web-app_2_4.xsd
javax/servlet/resources/web-app_2_5.xsd
javax/servlet/resources/web-app_3_0.xsd
javax/servlet/resources/web-common_3_0.xsd
javax/servlet/resources/web-fragment_3_0.xsd
javax/servlet/resources/xml.xsd

【讨论】:

【参考方案5】:

使用库 https://jar-download.com/maven-repository-class-search.php?search_box=org.apache.http.entity.mime 下载库并将其放入您的项目中

【讨论】:

【参考方案6】:

您需要 httpclient.jar 和 httpcore.jar。您可以从这里下载它们。

http://archive.apache.org/dist/httpcomponents/httpclient/binary/

【讨论】:

以上是关于我在哪里可以下载 org.apache.http 包的 jar?的主要内容,如果未能解决你的问题,请参考以下文章

org.apache.http.ProtocolException:未指定目标主机

eclipse缺少org.apache.http.legacy的解决办法

apache http客户端org.apache.http.NoHttpResponseException:目标服务器响应失败

Android 4.0 org.apache.http.conn.ConnectTimeoutException:连接到...超时

我在哪里可以下载 dwmapi.lib?

我在哪里可以下载 StoreKit.framework