Skip to content

Configure Stick2D Framework

Beatriz Franco Martins Souza edited this page May 7, 2015 · 12 revisions

Download:

  1. Download Eclipse Standard according your Operational System;
  2. Download SWIProlog;
  3. Download Slick2D;
  4. Download LWJGL standard bundle;
  5. 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.

Setting Up SWIProlog, Slick2D and LWJGL in Eclipse:

  1. Install Eclipse and run it;
  2. Go to Project --> Properties in the menu bar;
  3. Click on Java Build Path;
  4. Click Add Library...
  5. Select User Library;
  6. Click Next;
  7. Click User Libraries;
  8. In the user libraries dialog select New;
  9. For SWIProlog do:
    1. Type in SWIProlog or any other name that you want for the Library Name, click ok;
    2. Select the new library and:
      • click the Add Jar button (if the libraries were extracted to the project space);
      • click the Add External Jar button (if the libraries were placed at the SWIProlog folder outside the project space):
    C:\Program Files\swipl\lib\jpl.jar
  1. For Slick2D do:
    1. Type in Slick2D or any other name that you want for the Library Name, click ok;
    2. Select the new library and:
      • click the Add Jar button (if the libraries were extracted to the project space);
      • click the Add External Jar button (if the libraries were extracted to a location outside the project space);
  2. Go to where you extracted slick.zip and add the following '.jar' files ('Ctrl', or 'Shift' to select multiple entries) from 'lib' folder:
    • lwjgl.jar;
    • slick.jar;
    • jinput.jar;
    • lwjgl_util.jar (if want to use OpenGL's GLU class).

In the Java project:

  1. Right-Click your project node and click Build Path > Configure Build Path or;
  2. Go to Project > Properties and select Build Path, select the Libraries tab;
  3. Click Add Library;
  4. Select User Library, click next;
  5. Add your Slick2D Library, created as instructed above:
  6. Setup the Native Libraries path:
    1. From the Properties Dialog on the Library tab expand the Slick2D Library:
      • Click the Natives Library Location and click the Edit button;
      • Navigate to the location of the LWJGL native folder and select the sub folder for the specific OS;
      • Click OK;
    2. Alternatively before Running the project you have to add the following to the Run Configurations VM Arguments:
      • Select Run Configurtion;
      • Select the Project;
      • Select the Arguments tab;
  7. 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.