在 Eclipse 中安装 Apache common lang 2.5

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3091359/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:28:12  来源:igfitidea点击:

install Apache common lang 2.5 in Eclipse

eclipseapache

提问by tom

A newbie to Eclipse and Java...can anyone tell me how could I install the Apache common lang 2.5 in Eclipse?

Eclipse 和 Java 的新手……谁能告诉我如何在 Eclipse 中安装 Apache common lang 2.5?

http://commons.apache.org/lang/download_lang.cgi

http://commons.apache.org/lang/download_lang.cgi

Thanks!

谢谢!

采纳答案by londox

download commons-logging-1.2-bin.zip from http://commons.apache.org/proper/commons-logging/download_logging.cgi

http://commons.apache.org/proper/commons-logging/download_logging.cgi下载 commons-logging-1.2-bin.zip

Right click in your project then: Project Properties > Java Build Path > Library > add External JARS

右键单击您的项目,然后:项目属性 > Java 构建路径 > 库 > 添加外部 JARS

select commons-logging-1.2.jar and commons-logging-1.2-javadoc.jar from your downloaded unzip commons-logging-1.2-bin.zip

从下载的解压 commons-logging-1.2-bin.zip 中选择 commons-logging-1.2.jar 和 commons-logging-1.2-javadoc.jar

回答by tom

Detailed steps -

详细步骤——

0) Download commons-lang-2.5-bin.zip from Apache Commons - Lang Downloads http://commons.apache.org/lang/download_lang.cgiExpand the archive in a directory (eg. \projects\commons-lang-2.5)

0)从Apache Commons下载commons-lang-2.5-bin.zip - Lang Downloads http://commons.apache.org/lang/download_lang.cgi展开目录中的存档(例如\projects\commons-lang-2.5 )

In Eclipse -

在 Eclipse 中 -

1). Put the library in the Java build path

1)。将库放在 Java 构建路径中

Eclipse -> Preferences: Java - Build path - User Libraries push the "New..." button, and in the "User library name:" enter 'appache-commons-lang'.

Eclipse -> Preferences: Java - Build path - User Libraries 按下“New...”按钮,并在“User library name:”中输入“appache-commons-lang”。

Click to select "appache-commons-lang" in the "Defined user libraries" list and then click on the "Add JARs..." button and browse for commons-lang-2.5.jar (in the folder saved earlier) and select it.

在“定义的用户库”列表中点击选择“appache-commons-lang”,然后点击“添加JARs...”按钮,浏览commons-lang-2.5.jar(在之前保存的文件夹中)并选择它。

In the "Defined user libraries", under commons-lang-2.5.jar need to have "Source attachment" and "Javadoc location" specified. For each of them, select it, then push "Edit..." , then "External file" and browse for the corresponding jar (commons-lang-2.5-sources.jar and commons-lang-2.5-javadoc.jar)

在“定义的用户库”中,commons-lang-2.5.jar 下需要指定“源附件”和“Javadoc 位置”。对于它们中的每一个,选择它,然后按“编辑...”,然后按“外部文件”并浏览相应的 jar(commons-lang-2.5-sources.jar 和 commons-lang-2.5-javadoc.jar)

2) In the project add this user library In the Package Explorer right-click on the project name, go to Properties, and select the Libraries tab; click the "Add Library..." button, from the list select "User library" , "Next", mark [x] appache-commons-lang, and click "Finish"

2) 在项目中添加这个用户库 在 Package Explorer 中右键单击项目名称,转到 Properties,然后选择 Libraries 选项卡;单击“添加库...”按钮,从列表中选择“用户库”,“下一步”,标记 [x] appache-commons-lang,然后单击“完成”

回答by Piotr

You could create a User Libraryusing Apache Commons Lang in Eclipse. User library is a set of jars (these jars can be stored wherever you like). Once defined, user library can be reused in various projects.

您可以在 Eclipse 中使用 Apache Commons Lang创建一个用户库。用户库是一组罐子(这些罐子可以存放在你喜欢的任何地方)。定义后,用户库可以在各种项目中重复使用。

You can find more information how to do this for example here(in an accepted answer).

例如,您可以在此处(在已接受的答案中)找到有关如何执行此操作的更多信息。

After creating a user library you can add it to your projects just as any other library (Project Properties -> Java Build Path -> Libraries -> Add library -> User library -> Next -> choose your library).

创建用户库后,您可以像添加任何其他库一样将其添加到项目中(项目属性 -> Java 构建路径 -> 库 -> 添加库 -> 用户库 -> 下一步 -> 选择您的库)。

回答by Redlab

You could also do it on a per project basis

您也可以在每个项目的基础上进行

Right click your project -> buildpath -> configure buildpath -> add libraries -> add jar -> select the jar you want to add as dependency to your project

右键单击您的项目 -> 构建路径 -> 配置构建路径 -> 添加库 -> 添加 jar -> 选择要添加为项目依赖项的 jar

(or use maven which does it all for you on creating the eclipse project)

(或使用 maven 在创建 eclipse 项目时为您完成所有工作)

回答by sersem1

If the is an error when you try to install some plugin that declares apache.common.lang is missing, you can solve it by simply add to available update site this url : http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/

如果当您尝试安装一些声明 apache.common.lang 缺失的插件时出现错误,您可以通过简单地添加到可用更新站点这个 URL 来解决它:http: //download.eclipse.org/tools/orbit/下载/掉落/R20150124073747/repository/