[英]How to import libraries in Netbeans?
I am working on a Java program, where it will print the stored string in backwards. 我正在使用Java程序,它将向后打印存储的字符串。 And I would like to use the
ArrayUtils method.
而且我想使用ArrayUtils方法。
So, in order to do that, I have to import org.apache.commons.lang.ArrayUtils; 因此,为了做到这一点,我必须导入org.apache.commons.lang.ArrayUtils;。 (commons-lang-2.6.jar), which I dont have.
(commons-lang-2.6.jar),我没有。 And I would like to download it and add it to the library.
我想下载它并将其添加到库中。
Once I am in the commons.apache.org page and look for commons-lang-2.6.jar, there are actually 2 sections : 一旦进入commons.apache.org页面并查找commons-lang-2.6.jar,实际上就有2个部分:
Binaries, and Source. 二进制文件和源代码。
Which one should I download and how do I add the library? 我应该下载哪一个,以及如何添加该库?
the next link contains a jar file which you can import to your project (into libraries): http://www.java2s.com/Code/JarDownload/apache-commons/apache-commons-lang.jar.zip 下一个链接包含一个jar文件,您可以将其导入到您的项目中(到库中): http : //www.java2s.com/Code/JarDownload/apache-commons/apache-commons-lang.jar.zip
basically, the binaries files are compiled code and that is what you want. 基本上,二进制文件是编译后的代码,这就是您想要的。
"how do I add the library?"
“如何添加库?”
To add a new Library to NetBeans, 要将新的库添加到NetBeans,
Tools -> Library
a popup will come up. Tools -> Library
将弹出一个弹出窗口。 New Library
and give a name the new Library. New Library
并命名新库。 ClassPath
tab - click Add Jar/Folder
, locate and select. ClassPath
选项卡导入库-单击“ Add Jar/Folder
,找到并选择。 JavaDoc
tab. JavaDoc
选项卡添加javadoc。 You would add the file from the library file you downloaded, called javadoc
. javadoc
添加文件。 This will allow for the javadocs to be seen while editing your code. Sources
tab. Sources
选项卡添加源文件。 Import the file named sources
sources
的文件 Libraries
folder icon in your project and Add Library
Libraries
文件夹图标,然后Add Library
.jar
. .jar
。
Libraries
folder icon in your project and click Add Jar
Libraries
文件夹图标,然后单击“ Add Jar
.jar
file and add it. .jar
文件并添加它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.