Hi I've tried to install JME by using the following guide:
http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_netbeans_5.0_to_build_jme_and_jme-physics_2
(However I'm using netbeans 6.1.)
The problem is if I try to run tests and Lessons from jME-Physics 2. If I try to run de testscooser.java file I get some errors.
init:
deps-jar:
compile-single:
run-single:
24-dec-2008 16:43:33 jmetest.TestChooser start
INFO: Composing Test list…
24-dec-2008 16:43:33 jmetest.TestChooser find
INFO: Searching for Demo classes in "physics".
24-dec-2008 16:43:37 com.jme.system.PropertiesIO load
WARNING: Could not load properties. Creating a new one.
24-dec-2008 16:43:37 class com.jmetest.physics.TestBasicJoints start()
SEVERE: Exception in game loop
java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
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:111)
at com.jme.system.lwjgl.LWJGLPropertiesDialog$ModesRetriever.run(Unknown Source)
at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(Unknown Source)
at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(Unknown Source)
at com.jmetest.physics.SimplePhysicsTest.getAttributes(SimplePhysicsTest.java:63)
at com.jme.app.BaseGame.start(Unknown Source)
at com.jmetest.physics.TestBasicJoints.main(TestBasicJoints.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at jmetest.TestChooser.start(Unknown Source)
at com.jmetest.physics.TestChooser.main(TestChooser.java:47)
BUILD SUCCESSFUL (total time: 4 seconds)
Witch can't be good However it says Build succesfull it won't run.
What did I do wrong? :?
You need to add the lwjgl natives files to your classpath. The approach I recommend is the one I described in the Maven Setup Guide. As a side note you should also upgrade to NetBeans 6.5 ;).
Maven Guide:
http://www.jmonkeyengine.com/wiki/doku.php?id=jme_maven_setup#lwjgl_native_libraries
If that doesn't work or you have trouble with it let us know.
There are roughly a Quadrillion posts like this in the forum.
Core-Dump said:
There are roughly a Quadrillion posts like this in the forum.
Then it's time for an out-of-the-box solution where users don't have to worry about it anymore.
Both jME (graphics) and jME-Physics2 need to have the native LWJGL libraries supplied
(Its the same way for both, just add the runtime arguments…)
Maybe jme itself could load the native libraries, then there would be no need to specify them manually with java.library.path.
Maybe lib/native/[OS] could be the default search path, which could be overwritten by a property or the like.
That's an interesting idea…
Tomygun said:
You need to add the lwjgl natives files to your classpath. The approach I recommend is the one I described in the Maven Setup Guide. As a side note you should also upgrade to NetBeans 6.5 ;).
Maven Guide:
http://www.jmonkeyengine.com/wiki/doku.php?id=jme_maven_setup#lwjgl_native_libraries
If that doesn't work or you have trouble with it let us know.
Thx I think I fixed it :) :D
@Chaoslad:
Great!
@Core-Dump & basixs (following the thread hijacking)
I checked out LWJGL source code and found the code that loads the libraries:
…
String library_path = System.getProperty("org.lwjgl.librarypath");
if (library_path != null) {
System.load(library_path + File.separator + System.mapLibraryName(lib_name));
} else {
System.loadLibrary(lib_name);
}
…
All we have to do is set the value of "org.lwjgl.librarypath" from jME but the path has to be absolute. If the value is not set the usual happens, the natives are searched in every folder listed in System.getProperty("java.library.path").
This value can be provided as usual from the command-line when running (but this is what we are trying to avoid.)
java -jar -Dorg.lwjgl.librarypath="/usr/lib" file.jar
Anyway check the new Maven Guide were all this problems vanish (some new ones may arise though :)).