Difference between revisions of "Setting up Slick2D with Eclipse"
From Slick2D Wiki
(→Setting Up a Project to use LWJGL in Eclipse) |
|||
(3 intermediate revisions by 3 users not shown) | |||
Line 9: | Line 9: | ||
* Download [http://slick.ninjacave.com/slick.zip Slick2D] | * Download [http://slick.ninjacave.com/slick.zip Slick2D] | ||
− | * Download [http://www.lwjgl.org/download | + | * Download [http://www.lwjgl.org/download LWJGL] standard bundle |
* 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. | * 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. | ||
Line 57: | Line 57: | ||
-Djava.library.path=<lwjgl-X.X path>/native/<linux|macosx|solaris|windows> | -Djava.library.path=<lwjgl-X.X path>/native/<linux|macosx|solaris|windows> | ||
+ | |||
+ | MORE SIMPLE: | ||
+ | |||
+ | -Djava.library.path=<PATH WHERE YOU PUT SLICK> | ||
Note: Remember to select the natives of your operating system. | Note: Remember to select the natives of your operating system. | ||
[[Category:Tutorials]] | [[Category:Tutorials]] |
Latest revision as of 23:13, 8 May 2018
Contents
Introduction[edit]
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[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.
Setting Up Slick2D and LWJGL in Eclipse[edit]
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)[edit]
- 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>
MORE SIMPLE:
-Djava.library.path=<PATH WHERE YOU PUT SLICK>
Note: Remember to select the natives of your operating system.