How to set up slick2d and lwjgl

I have followed a few tutorials, but I dont know how to. I am new to java and eclipse. How do I set up the project? I dont get the whole workspace thing, how do I start from the absolute beginning. I know other programming languages so I am not new to programming. Just java and eclipse.
I posted this on the lwjgl forums. but it seems those forums are much less active than java gaming forums.

Pulling the latest Slick code from Bitbucket

I know I read that on the wiki but what i dont know is how to set up eclipse to work with slick. I dont understand that. What jars do i need and dont need from slick. There are a lot of them. And do I need to download lwjgl too or can i use the one that comes with slick?

This is how I was able to set up Slick2D.

  1. Create a folder on your desktop and name it whatever you want, for this example I will say it is named “Slick2D_Files”.
  2. Open up your browser.
  3. Go to http://lwjgl.org/, click download on the left, click latest build (first download link), save “lwjgl-2.8.4.zip” to Slick2D_Files.
  4. Go to http://slick.cokeandcode.com/, click “Download Full Distribution” on the right and save it to to Slick2D_Files.
  5. Open Eclipse, create a new project, create a folder called “libs”, create two folders inside this, one called “natives” and one called “jars”.
  6. Open up Slick2D_Files, open the lwjgl-2.8.4 folder, open the native folder, select all the contents (the linux, macosx, solaris, and windows folder) and drag and drop them into your natives folder.
  7. Go back to “lwjgl-2.8.4” and open the jar folder, select the lwjgl.jar and lwjgl_util.jar (you might not see the extension of .jar but it’s there) and drag those into your jars folder.
  8. Go back again to Slick2D_Files and open up the slick folder, open up the lib folder, select the slick.jar and drag it into your jars folder.
  9. In eclipse, right click your project and go all the way down to properties, once that is open click “Java Build Path” on the left, then click on Libraries tab.
  10. Click “Add JARs…”, select the three jar files that you have in your jars folder (located inside your lib folder).
  11. Click on the little carrot next to "lwjgl.jar - “Your_Project_Name”/lib/jars
  12. Click Native, library location:
  13. Click edit, click workspace, inside the lib folder open the natives folder and select your OS system.
  14. You’re done!

I’m going to edit this to make sure it’s understandable, if you have any questions please ask.

Thanks! Thats exactly what I needed. I have another question. what about distributing the final game? I would want to have a zip file to download, with all the assets and data and the jar file. But I dont want the users to have to click on the jar file, I would want either a .bat or .exe file to launch the jar itself. How would I set that up with the libraries and such outside of the packaged jar file?
I saw this post here, but I’m not sure why they do that:
http://slick.javaunlimited.net/viewtopic.php?f=27&t=4763#p27188

Wow. I copy-paste a pom.xml, change the name of the project, and type “mvn compile”. But for some reason people think that’s the more complicated solution.

Can you explain a bit better? I am a complete newby.

:clue: I’m not sure how to export yet since I’ve yet to need it (I haven’t finished my game yet). It’s very do-able and it seems more simple then setting up Slick2D. If you’re here to learn then exporting should be a lower priority imo. If for some reason you’d need to be able to export the project very soon, R.D.'s post on the link seems easy to follow, try that. Sorry for not being of much help for this area, if this part goes un-answered I’ll edit this post once I find out how to.

Not really. It involves using Maven, and if you’re using Slick out of bitbucket, the real story is actually a bit more involved than my flippant answer, at least until they start publishing artifacts to a repo (ruben01, you listening?). There’s a guide on the LWJGL wiki, but it’s out of date and I don’t recommend using the old version of Slick that one uses.

Oh ok. So what should I do for the distributing problem? And also, I would like it to be one download for all os’s if possible.

Sorry to ask but I remember reading this briefly else where, I’ve never used bitbucket but I’d assume it’s similar to Google Code where you can push and pull updates from the code? Should I learn to keep my projects updated from bitbucket’s Slick2D, that’s the most up to date code?

I wouldn’t keep every project using the latest dev branch, no. It’s just that slick hasn’t made any official releases since migrating to bitbucket, but it’s made enough changes that it’s worth using the new version, so that’s more or less what you’ll have to work with. For everything else, stick with a stable release version.

Another possiblity is libgdx, which comes with a wizard that will create eclipse projects for you. Just download and run http://libgdx.badlogicgames.com/nightlies/dist/gdx-setup-ui.jar and you’re good to go.

Ok thanks everyone, but i still need to know how should I distribute my game? My most favorable option would be a launcher type program like minecraft, in fact I would like to have the system like minecraft, the launcher, and the folder in appdata containing the jar, and all the libraries and natives. Is that possible? I dont need a fancy launcher, just some jar or exe that will automatically launch the right jar in my appdata folder, with the libraries and natives loading correctly with it.

I’m not really an expert in distribution, and I just stuff everything into one jar using the appropriately-named One-Jar. Other single-jar deployment solutions are possible with JarSplice, Scar, and no doubt a whole bunch of others. LWJGL itself has a deployment utility, though I can’t recall what it’s called (Minecraft uses a hacked version of it).

As for stuff that actually installs things into appdata and whatnot, I’d be looking at installers like NSIS or InstallAnywhere

If you mean this:
http://lwjgl.org/wiki/index.php?title=Deploying_with_the_LWJGL_Applet_Loader_-_Introduction
Thats just for applets. My game will be for pc, mac, and linux.

Just read the guide… it will pull everything you need, and then explain how to build slick. After that, just add the slick/lib folder to a User Library in Eclipse, as you would any other library. For example: for JARs, you will need to point to lwjgl.jar, slick.jar, ibxm.jar, jogg*.jar, jorbis*.jar, jinput.jar and a variety of others d

As for distribution, JarSplice is all you need.

EDIT: Ugh… I keep giving medals to everybody by accident. Appreciate it :slight_smile: