Eclipse 3.2, Win32: UnsatisfiedLinkError: no lwjgl in java.library.path

Hi!



I've read many posts about this returning question, but I can't solve it…:



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)

.

.

.



My Eclipse 3.2 doesn't seem to find the LWJGL DLLs… (I know).



Both jME and LWJGL are "installed" in c:devjme and c:devlwjgl dirs respectively. The lwjgl dir has the appropriate .nativewin32 dir containing the DLLs. But where in Eclipse 3.2 do I specify the -Djava.library.path="c:lwjglnativewin32" string so it can run my example? Compiling it works…



My Project home is in C:devtestapp. Do I use the wrong path delimiters? '/' instead of ''? Should I use relative paths like -Djava.library.path="…lwjglnativewin32"??



Here's the code I use:



package bla;

import org.lwjgl.;

import com.jme.app.
;



public class Main extends SimpleGame

{

public Main()

{

//

}



public static void main(String[] strArgs)

{

System.out.println("Hello world!");



SimpleGame sg = new Main();

sg.start();



System.out.println("Goodbye world!");

}



}



This code prints the Hello world! string in the Eclipse temrinal and then comes up with the exception, Goodbye world! is not printed.

Thanks for helping!
Karsten

PS: I think it would really help to make this thread sticky or add it to the list of FAQs...

if running from within eclipse try -Djava.library.path=${project_loc:jme}/lib (replace jme with the name of the jme project if you named it differently)

anyways remove those quotes. and imho using slashes instead of backslashes is a good practice anyways(i.e. if you work in a team and have shared run configurations).

Toss that -D crap.  Right click on the project -> Build Path -> Configure Build Path…  Under the 'Source' tab, expand your project and set the "Native Library Location" value to where the .DLLs are.  That's the proper Eclipsey way.  If you have a jME project separate from your own project, you only need to set that in the jME project.  Your project having a dependency on jME will automatically bring in the DLLs.

darn! i searched for that option but never found it :stuck_out_tongue: i always loked in the libraries tab



edit: seems i looked at the right tab but i was doing the wrong things: http://jmonkeyengine.com/mark/?p=162

Hmmm none of what you suggested works.



@sfera:

Whatever the library path has to with DLLs… I'm not sure what to try…



@White_Flame:

Basically I'd agree to toss the -D stuff… however, it's not a problem of compiling my app. It's about RUNNING it, so entering anything in some source/src tree probably misses the point.



The system somehow doesn't find the DLLs when using Eclipse's "Run…" , but I can't find the Eclipse way/place to tell where the DLLs are located. Even placing the DLLs directly into the WINNT/system32 dir had no effect.



I have no clue.



Karsten

adding the native lib to the lwjgl jar entry in the libraries tab works here.

i tried all these myself here (at work) only to make sure they work.

This works for me in eclipse:



Place the native libraries the root folder of your project (where eclipse has the .classpath and .project files), it will automatically find them here. Put all the other libraries (jars) in another package (src.lib is what I do) and make sure all these are incuded in the properties > java build path > libraries tab. I haven't ever had to explicitly include any natives, I just leave them in the root of my project and they get picked up.

Which jME and LWJGL did you "install"? Make sure they're compatible



http://www.jmonkeyengine.com/wiki/doku.php?id=lwjgl_version_to_be_used_with_different_jme_releases

Basically I'd agree to toss the -D stuff... however, it's not a problem of compiling my app. It's about RUNNING it, so entering anything in some source/src tree probably misses the point.


Uh, don't blow this one off before trying it, it IS the solution. Unfortunately in 3.2 it doesn't seem to work as well as it once did, making this setting for the jme project allows it to work with the testchooser, but my other projects that are dependant on the jme project had to have the jars with the library path set in them too.

I still have absolutely no clue why Eclipse doesn't find the native DLLs. When using the MS command prompt



java -cp .;bin;…lwjgljarlwjgl.jar;…lwjgljarlwjgl_test.jar;…lwjgljarlwjgl_util.jar;…lwjgljarlwjgl_fmod3.jar;…lwjgljarlwjgl_devil.jar;…lwjgljarjinput.jar; -Djava.library.path=…lwjglnativewin32 odin.Odin



Everything works fine… still no can do in Eclipse. I tried so many things. Please refer to



http://lwjgl.org/forum/viewtopic.php?p=11114#11114



What I did now was to put the DLLs into the directory which Eclipse showed the javaws.exe was in… that basically solved this absolutely unsolvable situation… brute-force crap…



The code:



package odin;



import org.lwjgl.;



import com.jme.app.
;



import odin.cfg.*;



public class Odin extends SimpleGame

{

public Odin()

{

}



protected void simpleInitGame()

{

}



public static void main(String[] args)

{

System.out.println("Hello world!");



//does all Java environment printing (static initializer)

Object o = Config.class;



//LWJGL test

System.out.println("LWJGL version = " + Sys.getVersion());



//jME test

SimpleGame sg = new Odin();

sg.start();



System.out.println("Goodbye world!");



}



}



… now outputs:



Hello world!

Root directory is 'C:devodin'.

java.class.path = C:devodinbin

java.library.path = C:devlwjglnativewin32

Java VM is located at 'C:ProgrammeJavajre1.6.0'.

User home directory is 'C:Dokumente und Einstellungenkawu'.

JVM version is '1.6.0-beta-b59g'.

Java version is '1.6.0-beta'.

Your JVM has passed the version test. Needed is 1.5. You have version 1.6.0-beta

LWJGL version = 1.0beta3

28.09.2006 03:13:20 com.jme.app.BaseGame start

INFO: Application started.

28.09.2006 03:13:20 com.jme.system.PropertiesIO <init>

INFO: PropertiesIO created

28.09.2006 03:13:20 com.jme.system.PropertiesIO load

INFO: Read properties

28.09.2006 03:13:20 com.jme.input.joystick.DummyJoystickInput <init>

INFO: Joystick support is disabled

28.09.2006 03:13:20 com.jme.system.lwjgl.LWJGLDisplaySystem <init>

INFO: LWJGL Display System created.

28.09.2006 03:13:20 com.jme.renderer.lwjgl.LWJGLRenderer <init>

INFO: LWJGLRenderer created. W:  640H: 480

28.09.2006 03:13:20 com.jme.renderer.AbstractCamera <init>

INFO: Camera created.

28.09.2006 03:13:20 com.jme.util.lwjgl.LWJGLTimer <init>

INFO: Timer resolution: 1000 ticks per second

28.09.2006 03:13:21 com.jme.scene.Node <init>

INFO: Node created.

java.lang.NullPointerException

at com.jme.scene.Text.getDefaultFontTextureState(Unknown Source)

at com.jme.scene.Text.createDefaultTextLabel(Unknown Source)

at com.jme.scene.Text.createDefaultTextLabel(Unknown Source)

at com.jme.app.BaseSimpleGame.initGame(Unknown Source)

at com.jme.app.BaseGame.start(Unknown Source)

at odin.Odin.main(Odin.java:43)

28.09.2006 03:13:21 com.jme.app.BaseSimpleGame cleanup

INFO: Cleaning up resources.

28.09.2006 03:13:21 com.jme.app.BaseGame start

INFO: Application ending.



Huh? What now?



OK, the Hello world string is printed, the Config.class resolver (static initializer) prints some Java stuff (which can basically be omitted now). Then, some



java.lang.NullPointerException

at com.jme.scene.Text.getDefaultFontTextureState(Unknown Source)



is thrown… and the app terminates.



Again, running this via the command prompt shows the window showing the 457 flickering fps.



Does anyone know what's wrong now?



TIA

Karsten



PS: ZZZ g'night

just an observation: i don't see jme in the classpath of your command line.

I have updated the wiki to add a Visual, step-by-step tutorial on how to get jME working with Eclipse.



http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_eclipse_to_build_jme#the_visual_guide



Enjoy.

this is really great :slight_smile:

let's hope people won't ask why they can't log into the cvs with user 'guurk' and password '******' :stuck_out_tongue: (just joking )

You joke, but I'm guessing it will happen at least once…  XD

Excellent



except -Djava.library.path=./lib must die :stuck_out_tongue:



http://jmonkeyengine.com/mark/?p=162

yes, but after all that work he did i didn't want to criticize him :slight_smile:

btw: the visual thingy should be before the playin text thingy in the wiki imho :stuck_out_tongue:



edit:

@renanse: i added a note about using the guest account for dev.java.net in the hope java/cvs newbies will take the path of least effort

guurk said:

I have updated the wiki to add a Visual, step-by-step tutorial on how to get jME working with Eclipse.

http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_eclipse_to_build_jme#the_visual_guide

Enjoy.



Nice tuto. The UnsatisfiedLinkError stuff still doesn't help ME!

It seems my Eclipse install @work AND @home seem to have some "personal" problem... both Eclipses simply don't like to accept the native libararies, they aren't found - unless I copy them *directly* into the JRE/javaw dir show by Eclipse when running.

I have really tried Run... VM argument stuff sooooooooooo many times, I'm starting to get nightmares... 50 tries is nothing!

I have no clue why I seem to be the only one around not getting it to work... *sigh*

Karsten

PS: I'm giving up...

Did you try specifying a direct path rather than a relative path?

llama said:

Excellent

except -Djava.library.path=./lib must die :P

http://jmonkeyengine.com/mark/?p=162


You make a good point llama, I actually use that within my own application. Ah, feel free to update the tutorial :).

You are not the only person to have this problem, I seem to have it every time I update from CVS or install jME on a new computer (and of course update from CVS) and I've had all kinds of problem's with eclipse 3.2 (though cleaning projects seems to go a long ways towards fixing those when I hit them). Usually when I get frustrated and give up the light turns on and I figure it out/try it one last time and somehow it works even though I did the same thing over and over.