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.
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.
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.
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.
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
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.
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*
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.