Setting Up LWJGL with NetBeans

From LWJGL
Revision as of 04:49, 9 December 2010 by JediTofu (Talk | contribs)

Jump to: navigation, search

Introduction

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.
Top


Downloading and Setting Up LWJGL

Here are the first steps that are required for any IDE.

  1. 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.
  2. 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.
  3. Extract lwjgl-X.X.zip and lwjgl-source-X.X.zip.
    • lwjgl-docs-X.X.zip does not need to be extracted.

Top


Setting Up LWJGL in NetBeans

  1. Open up NetBeans.
  2. Go to Tools|Libraries in the main menu.
    • NetBeans1.png

  3. Click on the New Library button.
    • NetBeans2.png

  4. 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.
    • NetBeans3.png

  5. 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.
    • NetBeans4.png

  6. 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.
    • NetBeans5.png

  7. The rest of these steps are optional.
  8. 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.
    • NetBeans6.png

  9. 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.*

Top


Setting Up a Project to Use LWJGL in NetBeans