Sign in to follow this  

error trying to setup slick2d with eclipse

This topic is 1832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi there, i was following a tutorial on how to set up slick2d and lwjgl with eclipse and after finishing it and starting on a project i keep getting this message in the console:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
at org.lwjgl.Sys.loadLibrary(Sys.java:84)
at org.lwjgl.Sys.<clinit>(Sys.java:101)
at org.lwjgl.opengl.Display.<clinit>(Display.java:128)
at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
at simpleGame.SimpleGame.main(SimpleGame.java:39)

any idea what i did wrong trying to set up slick?


cheers

Share this post


Link to post
Share on other sites
That is the error you will get when lwjgl tries to load the system *.dll files (if you're on windows).

You can add the folder with the dll files to your windows PATH environment variable, or somewhere in the startup script, set the java.library.path variable:

-Djava.library.path=C:/lwjgl/native

I am not familiar with this issue in Slick, but I've had the same issue plenty of times. When using Tomcat to load native libraries, I've also had to reboot the computer after setting the path.

If that doesn't work, post some more info. There is no way you're the only person having this problem smile.png

Ciao, Edited by Glass_Knife

Share this post


Link to post
Share on other sites
cheers for the reply mate, i followed the slick2d tutorial on how to set it up and it looked like it worked until i got a different message:


Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Craig\Desktop\lwjgl-2.8.5\native\windows\lwjgl.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
at org.lwjgl.Sys.loadLibrary(Sys.java:84)
at org.lwjgl.Sys.<clinit>(Sys.java:101)
at org.lwjgl.opengl.Display.<clinit>(Display.java:128)
at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
at games.SlickBasicGame.main(SlickBasicGame.java:82)

anyone know what the problem is now? Edited by Darego

Share this post


Link to post
Share on other sites

Are you using 64bit version of Eclipse & Java VM?

 

It looks like Slick2D is trying to load 32bit native dll's.

 

LWJGL does provide 64bit builds; but you will probably need to modify your Slick2D build to load them.

Share this post


Link to post
Share on other sites

thanks for the replies. i used your tutorial P0jahn and got it all working. i now have a new error when trying to run a program 

 

 

 

Exception in thread "main" java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to java.io.IOException
at org.newdawn.slick.opengl.CompositeIOException.getMessage(CompositeIOException.java:37)
at org.newdawn.slick.util.DefaultLogSystem.error(DefaultLogSystem.java:32)
at org.newdawn.slick.util.Log.error(Log.java:109)
at org.newdawn.slick.Image.<init>(Image.java:198)
at org.newdawn.slick.Image.<init>(Image.java:170)
at org.newdawn.slick.Image.<init>(Image.java:158)
at org.newdawn.slick.Image.<init>(Image.java:136)
at slick.path2glory.tutorial1.SlickBasicGame.init(SlickBasicGame.java:27)
at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
at slick.path2glory.tutorial1.SlickBasicGame.main(SlickBasicGame.java:85)

 

the code i am using is at the end of this page under "Full Source Code":

 

http://www.slick2d.org/wiki/index.php/Spiegel_tutorials/01_-_A_Basic_Slick_Game

 
Edited by Darego

Share this post


Link to post
Share on other sites

found the problem. the plane image was corrupt for some reason, i made a new one and it worked. thanks again guys

Share this post


Link to post
Share on other sites
Sign in to follow this