Setting up Slick2D with NetBeansIDE

From Slick2D Wiki
Jump to: navigation, search

Introduction[edit]

This tutorial will run you through the steps you'll need to set Slick2D up with NetBeans.

Since Slick2D uses LWJGL, setup is split into 2 parts, the JAR files, and the LWJGL natives (*.dll files for Windows, *.so files for Unix and Linux and *.dylib/*.jnilib for Mac).


Downloading and Extracting Slick2D and LWJGL[edit]

  • Extract the LWJGL zip (lwjgl-x.x.zip) file somewhere in your computer, remember or note down the location, you will need this later. We suggest you create a library (/lib) folder to store all these files in a well-known place.
  • As of 9/16, the above Slick2D link will download a version that is not compatible with LWJGL 3. Try 2.9.3 instead.

Setting Up Slick2D and LWJGL in NetBeans[edit]

Extracted from LWJGL with Netbeans

  1. Open up NetBeans.
  2. Go to Tools --> Libraries in the menu bar.
  3. Click on the New Library button.
  4. Type in Slick2D or any other name that you want for the Library Name.
  5. Select Classpath tab for your newly created Library and then click the Add JAR/Folder... button.
  6. Go to where you extracted lwjgl-X.X.zip and add the following '.jar'('Ctrl' or 'Alt' to select multiple files)
    1. lwjgl.jar
    2. slick.jar
    3. jinput.jar
    4. lwjgl_util.jar (if want to use OpenGL's GLU class)


Setting Up a Project to use LWJGL in NetBeans[edit]

  • In a new Java project:
  1. Right-Click your project node or go to File>Project Properties and select Libraries
  2. Add your Slick2D Library , created as instructed above
  3. Select Run
  4. On VM Options put the following:
   -Djava.library.path=<lwjgl-X.X path>/native/<linux|macosx|solaris|windows> 

Note: Remember to select the natives of your operating system.