简体   繁体   中英

How to import libraries in Netbeans?

I am working on a Java program, where it will print the stored string in backwards. And I would like to use the method. 方法。
So, in order to do that, I have to import org.apache.commons.lang.ArrayUtils; (commons-lang-2.6.jar), which I dont have. 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 :
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

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,

  • do the following ( after downloading and extracting the library you need)
    1. If you click Tools -> Library a popup will come up.
    2. There you can add a new library. Click on New Library and give a name the new Library.
    3. Import a library from the ClassPath tab - click Add Jar/Folder , locate and select.
    4. If you want to can also add the javadoc from the JavaDoc tab. You would add the file from the library file you downloaded, called javadoc . This will allow for the javadocs to be seen while editing your code.
    5. Also you can add the sources file form the Sources tab. Import the file named sources
    6. Then right-click on the Libraries folder icon in your project and Add Library
  • Another option is just add the .jar .
    1. Right-click on the Libraries folder icon in your project and click Add Jar
    2. Locate the .jar file and add it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM