Netbeans and libraries (for dummies)

Discussion in 'Plugin Development' started by Rednax_, Nov 6, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Rednax_

    With this thread I hope to solve future problems of other people.

    When you have added your libraries to netbeans, your imports still don't work.
    solution:

    restart netbeans.

    I know, its lame, its a bug in Netbeans...

    How to add the libraries in the first place:

    1. download em, link can be found on the bukkit wiki somewhere.

    2. give them a fancy name, such as "bukkit.jar" instead of "bukkit-0.0.1-snapshot.jar" (not not the quotes of course!)

    3. Give them a nice little place on your hard disk to grow old, such as .../netbeansprojects/LIBS/bukkit,jar

    4. Open Netbeans and go to tools -> libraries

    5. Click on new library and give it a nice name

    6. At the classpath tab, click on add jar/folder and add the bukkit library jar file. (the one you gave a nice little place on your hard disk

    7. At the javadoc tab, add the javadoc url, you can find it at the bukkit wiki main page. current url (6-nov-2011) is http://jd.bukkit.org/apidocs/index.html
    this step is optional, but VERY useful later on.

    8. open/create your plugin.

    9. in the projects tab, find the library tab of your project, right click it and select add library

    10 find the library you gave a name at step 5.

    11 after pressing the add library button, restart netbeans.

    12 test it by importing something from org.bukkit, example:
    import org.bukkit.plugin.Plugin;
    (add this line at the top of a .java file, where you type your code and stuff, just below the package line)

    Why would you use netbeans and not eclipse?
    Because you don't like eclipse.

    If this is not true, go ahead and use eclipse, nothing wrong with it.

    Hope this help,

    Rednax

    Feel free to copy paste this stuff to other places on the web, its meant to help, not to receive credits.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 21, 2016
    XDdrummer likes this.
  2. Offline

    MordorKing78

    Im just to stupid to understand how to import in netbeans.. ;)
     
Thread Status:
Not open for further replies.

Share This Page