简体   繁体   English

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

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

I tried in Eclipse to use org.apache.commons.lang.NotImplementedException , though it seems from what I can see both from IntelliSense and 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 ) 这是我目前的设置:( 链接死机

Download the commons lang library and 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. 编辑(2016/02):现在似乎没有按原样提供.jar文件。 You have to get the "binary" archive (eg "commons-lang3-3.4-bin.zip") from the same download page and extract it. 您必须从同一下载页面获取“二进制”存档(例如“commons-lang3-3.4-bin.zip”)并将其解压缩。 The required jar files are inside the extracted folder. 所需的jar文件位于解压缩的文件夹中。

To add the jar to your eclipse project library: 要将jar添加到eclipse项目库:

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

You need to add Apache commons jar file to the project. 您需要将Apache commons jar文件添加到项目中。 You can select the jar you want from here - http://commons.apache.org/downloads/index.html 您可以从这里选择所需的jar - http://commons.apache.org/downloads/index.html
for lang you need this - commons-lang-2.5.jar 对于lang你需要这个 - commons-lang-2.5.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java:无法解析导入org.apache.commons.lang [Eclipse] - Java: The import org.apache.commons.lang cannot be resolved [Eclipse] 包org.apache.commons.lang不存在[Netbeans] - package org.apache.commons.lang does not exist [Netbeans] 无法在JSP页面上导入org.apache.commons.lang - Trouble importing org.apache.commons.lang on JSP page 删除org.apache.commons.lang模板中的$ {var}以获取空白值 - Remove ${var} in org.apache.commons.lang templates for blank values 如何在没有 IDE 的情况下使用 Apache Commons Lang 代码? (org.apache.commons.lang3) - How to use Apache Commons Lang code without an IDE? (org.apache.commons.lang3) java.lang.NoClassDefFoundError:org / apache / commons / lang / text / StrLookup - java.lang.NoClassDefFoundError: org/apache/commons/lang/text/StrLookup java.lang.NoClassDefFoundError: org/apache/commons/lang/builder/CompareToBuilder - java.lang.NoClassDefFoundError: org/apache/commons/lang/builder/CompareToBuilder org.apache.commons.lang.SerializationException:java.lang.ClassNotFoundException - org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException java.lang.NoClassDefFoundError:org.apache.commons.lang3.ArrayUtils - java.lang.NoClassDefFoundError: org.apache.commons.lang3.ArrayUtils java.lang.NoClassDefFoundError:org / apache / commons / lang / Validate - java.lang.NoClassDefFoundError: org/apache/commons/lang/Validate
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM