Difference between revisions of "Setting up Slick2D with Eclipse"
From Slick2D Wiki
(→Setting Up a Project to use LWJGL in Eclipse) |
(→Setting Up a Project to use LWJGL in Eclipse) |
||
Line 36: | Line 36: | ||
## lwjgl_util.jar (if want to use OpenGL's GLU class) | ## lwjgl_util.jar (if want to use OpenGL's GLU class) | ||
− | ==Setting Up a Project to use LWJGL in Eclipse== | + | ==Setting Up a Project to use LWJGL in Eclipse (as of January 2015)== |
* In a new Java project: | * In a new Java project: |
Revision as of 14:25, 14 June 2016
Contents
Introduction
This tutorial will run you through the steps you'll need to set Slick2D up with Eclipse.
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
- 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 Slick2D and LWJGL in Eclipse
Extracted from LWJGL with Eclipse
- Open up Eclipse.
- Go to Project --> Properties in the menu bar.
- Click on Java Build Path.
- Click Add Library...
- Select User Library
- Click Next
- Click User Libraries
- In the user libraries dialog select New
- Type in Slick2D or any other name that you want for the Library Name, click ok
- 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)
- 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)
Setting Up a Project to use LWJGL in Eclipse (as of January 2015)
- In a new Java project:
- Right-Click your project node and click Build Path > Configure Build Path or
- Go to Project > Properties and select Build Path, select the Libraries tab
- Click Add Library
- Select User Library, click next
- Add your Slick2D Library, created as instructed above
- Setup the Native Libraries path
- 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
- 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
- On VM Options put the following:
- From the Properties Dialog on the Library tab expand the Slick2D Library
-Djava.library.path=<lwjgl-X.X path>/native/<linux|macosx|solaris|windows>
Note: Remember to select the natives of your operating system.