在 Eclipse 上安装 Apache 包
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4706212/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Install Apache Package on Eclipse
提问by Mascarpone
I'm trying to get started with Http Clientwith Java on Eclipse, but the IDE complains that the libraries are missing.
我正在尝试在 Eclipse 上开始使用带有 Java 的Http Client,但 IDE 抱怨缺少这些库。
In particular I'm trying to compile thisexample but eclipse complain that the import declaration is pointing towards an unknow library...
特别是我试图编译这个例子,但 Eclipse 抱怨导入声明指向一个未知的库......
Could someone point me to a tutorial on how to install the apache libraries on eclipse?
有人可以指点我关于如何在 Eclipse 上安装 apache 库的教程吗?
I tried to download the sources or binaries and adding them to the path with no avail... thanx :D
我试图下载源代码或二进制文件并将它们添加到路径中,但无济于事......thanx :D
回答by BalusC
They need to go in the compiletime/runtime classpath. It's called Build Pathin an IDE like Eclipse.
他们需要进入编译时/运行时类路径。它在 Eclipse 等 IDE 中称为构建路径。
Here's the easiest way:
这是最简单的方法:
- Drop the JARs in the project folder.
- Select the JARs, right click, choose Build Pathand then Add to Build Path.
- 将 JAR 放到项目文件夹中。
- 选择 JAR,右键单击,选择Build Path然后Add to Build Path。
回答by dogbane
- Download the HTTPClient jars and save them in the project.
- Right click the project name and navigate to
Build Path
. - Select
Configure Build Path
- Select the
Libraries
tab. - Click
Add Jars...
- Locate and select the JARs you want and click
OK
.
- 下载 HTTPClient jar 并将它们保存在项目中。
- 右键单击项目名称并导航到
Build Path
. - 选择
Configure Build Path
- 选择
Libraries
选项卡。 - 点击
Add Jars...
- 找到并选择您想要的 JAR,然后单击
OK
。