如何在 Java 中使用 org.apache.commons.lang 命名空间?

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

How to use org.apache.commons.lang namespace in Java?

javaeclipse

提问by devoured elysium

I tried in Eclipseto use org.apache.commons.lang.NotImplementedException, though it seems from what I can see both from IntelliSenseand the Package Explorer, that that namespace does not exist.

我尝试在Eclipse中使用org.apache.commons.lang.NotImplementedException,尽管从IntelliSensePackage Explorer 中都可以看到,该命名空间不存在。

So I guess I must load some other package(do you call them libraries in java?) than those it loaded by default.

所以我想我必须加载一些其他包(你在java中称它们为库吗?)而不是默认加载的包。

This is my current setup: (link dead)

这是我当前的设置:(链接已死

采纳答案by Padmarag

You need to add Apache commons jar file to the project. You can select the jar you want from here - http://commons.apache.org/downloads/index.html
for lang you need this - commons-lang-2.5.jar

您需要将 Apache commons jar 文件添加到项目中。你可以从这里选择你想要的 jar - http://commons.apache.org/downloads/index.html
for lang 你需要这个 - commons-lang-2.5.jar

回答by marklai

Download the commons lang libraryand add it to your eclipse project library.

下载commons lang 库并将其添加到您的 eclipse 项目库中。

EDIT (2016/02) : it seems that nowadays the .jar files are not provided as is. You have to get the "binary" archive (e.g. "commons-lang3-3.4-bin.zip") from the same download page and extract it. The required jar files are inside the extracted folder.

编辑(2016/02):现在似乎没有按原样提供 .jar 文件。您必须从同一下载页面获取“二进制”存档(例如“commons-lang3-3.4-bin.zip”)并将其解压缩。所需的 jar 文件位于提取的文件夹中。

To add the jar to your eclipse project library:

要将 jar 添加到您的 eclipse 项目库:

  1. open project properties
  2. choose Java Build Path
  3. tab to Libraries
  4. add jars (if the jar is inside your project folder)
  5. add external jar (if the jar is outside your project folder)
  1. 打开项目属性
  2. 选择 Java 构建路径
  3. 选项卡到库
  4. 添加罐子(如果罐子在你的项目文件夹中)
  5. 添加外部 jar(如果 jar 在您的项目文件夹之外)