Setting Up LWJGL with NetBeans
This tutorial will show you how to setup LWJGL with the NetBeans IDE.
Requirements: You should have NetBeans (and Java) installed and should be familiar with creating a new Java project in NetBeans and extracting Zip files.
Note: X.X anywhere denotes the version number of LWJGL that you are downloading and setting up.
Downloading and Setting Up LWJGL
Here are the first steps that are required for any IDE.
- Create a dedicated folder for LWJGL and remember its location. This folder will be the permanent residence of LWJGL on your system. Optionally, name it "lwjgl-X.X" to denote it from earlier/later versions.
- Download LWJGL from here.
- lwjgl-X.X.zip is the only one required.
- (Recommended.) Download lwjgl-docs-X.X.zip if you want to be able to see LWJGL's Javadoc within NetBeans.
- (Recommended.) Download lwjgl-source-X.X.zip if you want to be able to navigate to LWJGL's source code within NetBeans.
- (Optional.) Download lwjgl_applet-X.X.zip if you want to be able to create Java Applets with LWJGL. This exceeds the scope of this tutorial; for more information, please go to the LWJGL Applet tutorials.
- Extract lwjgl-X.X.zip and lwjgl-source-X.X.zip.
- lwjgl-docs-X.X.zip does not need to be extracted.
Setting Up LWJGL in NetBeans
- Open up NetBeans.
- Go to Tools|Libraries in the main menu.
- Click on the New Library button.
- Type in LWJGL or LWJGL-X.X to denote it from earlier/later versions or any other name that you want for the Library Name.
- Always make sure that the correct Library is selected; you don't want to accidentally modify another Library. Now select the Classpath tab for your newly created Library and then click the Add JAR/Folder... button.
- Go to the folder where you extracted lwjgl-X.X.zip and then go into the jar folder. The only JARs that you really need are lwjgl.jar, lwjgl_util.jar, and jinput.jar. In most Operating Systems, you can select multiple files by holding down the Ctrl key while you click so that you can just do this in one step.
- The rest of these steps are optional.
- Select the Sources tab and then click the Add JAR/Folder... button. Next, go to the folder where you extracted lwjgl-source-X.X.zip and then go into the src folder. Select the generated and java folders.
- Select the Javadoc tab and then click the Add JAR/Folder... button. Finally, select wherever you put lwjgl-docs-X.X.zip, and we are done. Phew. *Wipes sweat from forehead.*