i'm using netbeans, and i have wrote an application using jme. i have included some jars in the library in the IDE, when i compile and run the application from IDE it works. But when i clean and build the main project and i run it outside from IDE it doesn't work i get the following error when i run it from console :
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
F:Documents and SettingsKonjo>java -jar "F:Documents and SettingsKonjoKvizS
E 5.0distKvizSE_5.0.jar"
13.08.2007. 17.58.26 com.jme.app.BaseGame start
INFO: Application started.
13.08.2007. 17.58.26 com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
13.08.2007. 17.58.26 com.jme.system.PropertiesIO load
WARNING: Could not load properties. Creating a new one.
java.lang.UnsatisfiedLinkError: getNativeLibraryVersion
at org.lwjgl.DefaultSysImplementation.getNativeLibraryVersion(Native Met
hod)
at org.lwjgl.Sys.<clinit>(Sys.java:100)
at org.lwjgl.opengl.Display.<clinit>(Display.java:103)
at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(Unknown Source)
at com.jme.app.AbstractGame.getAttributes(Unknown Source)
at com.jme.app.BaseGame.start(Unknown Source)
at kvizse50.Stanje.main(Stanje.java:33)
13.08.2007. 17.58.26 kvizse50.Game cleanup
INFO: Cleaning up resources...
13.08.2007. 17.58.26 com.jme.app.BaseGame start
INFO: Application ending.
in my "dist" folder i have the file "KvizSE_5.0.jar" and the folder called "lib" where are all the *.jar -s that i have included in the IDE.
Also here is my MANIFEST file :
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_09-b03 (Sun Microsystems Inc.)
Main-Class: kvizse50.Stanje
Class-Path: lib/jme-awt.jar lib/jme-editors.jar lib/jme-effects.jar li
b/jme-font.jar lib/jme-gamestates.jar lib/jme-model.jar lib/jme-scene
.jar lib/jme-sound.jar lib/jme-terrain.jar lib/jme-ui.jar lib/jme.jar
lib/jmetest-data.jar lib/jmetest.jar lib/jme-bui.jar lib/jinput.jar
lib/jogg-0.0.5.jar lib/jorbis-0.0.12.jar lib/lwjgl.jar lib/lwjgl_appl
et.jar lib/lwjgl_fmod3.jar lib/lwjgl_test.jar lib/lwjgl_util.jar lib/
lwjgl_util_applet.jar lib/native-mac.jar
X-COMMENT: Main-Class will be added automatically by build
i have also tryed to copy all the libs and dlls found in "jME" and "jME/lib" into "D:/Windows/System32/" and my working directory, but it still doesn't work.
I know it's something stupid and obvious so please help.
easiest soluition: put the lwjgl-dlls in d:windows or d:windowssystem32 (i think both will work)
i have tryed that, and thought it isn't a safe soulution it still doesn't work.
your solution hevee also doesn't work ...
i have created a folder named "dll" in my working dir, i have put all the files from "jME/lib" there.
i have ran my application like this :
F:Documents and SettingsKonjo>java -jar "F:Documents and SettingsKonjoKvizS
E 5.0distKvizSE_5.0.jar" -Djava.library.path="dll"
13.08.2007. 19.30.19 com.jme.app.BaseGame start
INFO: Application started.
13.08.2007. 19.30.19 com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
13.08.2007. 19.30.19 com.jme.system.PropertiesIO load
WARNING: Could not load properties. Creating a new one.
java.lang.UnsatisfiedLinkError: getNativeLibraryVersion
at org.lwjgl.DefaultSysImplementation.getNativeLibraryVersion(Native Met
hod)
at org.lwjgl.Sys.<clinit>(Sys.java:100)
at org.lwjgl.opengl.Display.<clinit>(Display.java:103)
at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(Unknown Source)
at com.jme.app.AbstractGame.getAttributes(Unknown Source)
at com.jme.app.BaseGame.start(Unknown Source)
at kvizse50.Stanje.main(Stanje.java:33)
13.08.2007. 19.30.19 kvizse50.Game cleanup
INFO: Cleaning up resources...
13.08.2007. 19.30.19 com.jme.app.BaseGame start
INFO: Application ending.
F:Documents and SettingsKonjo>java -jar "F:Documents and SettingsKonjoKvizSE 5.0distKvizSE_5.0.jar" -Djava.library.path="dll"
Is that correct? Let's see...
java -help
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
As you can see, JVM options have to be specified before the jarfile. The way you posted above, you are specifying the -Djava.library.path argument as an argument to your own java application, not the jvm.
Did you copy that from wiki? Then please correct it there, or tell us where you found it. Hope that helps this time :)
i have tryed that again, and there's a problem again…
F:Documents and SettingsKonjo>java -Djava.library.path="dll" -jar "F:Documen
ts and SettingsKonjoKvizSE 5.0distKvizSE_5.0.jar"
Exception in thread "main" java.lang.NoClassDefFoundError: and
it's like the sentence isn't finished, but that's all the output i get...
F:Documents and SettingsKonjo>java -Djava.library.path="dll" -jar "F:Documents and SettingsKonjoKvizSE 5.0distKvizSE_5.0.jar"
Exception in thread "main" java.lang.NoClassDefFoundError: and
it's like the sentence isn't finished, but that's all the output i get...
The sentence is finished. Java is looking for the class "and", because the backslash in "dll" invalidates the " after it. Try using two backslashes, or leave the backslash out, it's not neccessary. BTW, the quotation marks " are only needed for paths containing whitespace, so you could leave them out as well.
EDIT: renanse beat me to it, but I thought I might just post mine anyway :D
i'm back at the begining. and just so you know, the command isn't split int two lines, it's just displayed that way in MS prompt.
i think the jre can find the dlls, 'cause i copied them to windowssystem32 too, could this be some other problem ?
F:Documents and SettingsKonjo>java -Djava.library.path="dll" -jar "F:Document
s and SettingsKonjoKvizSE 5.0distKvizSE_5.0.jar"
14.08.2007. 10.04.06 com.jme.app.BaseGame start
INFO: Application started.
14.08.2007. 10.04.06 com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
14.08.2007. 10.04.06 com.jme.system.PropertiesIO load
WARNING: Could not load properties. Creating a new one.
java.lang.UnsatisfiedLinkError: getNativeLibraryVersion
at org.lwjgl.DefaultSysImplementation.getNativeLibraryVersion(Native Met
hod)
at org.lwjgl.Sys.<clinit>(Sys.java:100)
at org.lwjgl.opengl.Display.<clinit>(Display.java:103)
at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(Unknown Source)
at com.jme.app.AbstractGame.getAttributes(Unknown Source)
at com.jme.app.BaseGame.start(Unknown Source)
at kvizse50.Stanje.main(Stanje.java:33)
14.08.2007. 10.04.06 kvizse50.Game cleanup
INFO: Cleaning up resources...
14.08.2007. 10.04.06 com.jme.app.BaseGame start
INFO: Application ending.
F:Documents and SettingsKonjo>
i hope i'm not bothering you too much with this...
The java.library.path is relative to the working directory. Not the directory of the jar. I assume your ‘dll’ folder is in ‘F:Documents and SettingsKonjoKvizSE 5.0dist’, right?
Additionally take care that there are no old lwjgl.dll’s in system32, windows or anywhere else in the path, as the message means it has found the dll but not the correct function in it.
The java.library.path is relative to the working directory. Not the directory of the jar. I assume your 'dll' folder is in 'F:Documents and SettingsKonjoKvizSE 5.0dist', right?
Additionally take care that there are no old lwjgl.dll's in system32, windows or anywhere else in the path, as the message means it has found the dll but not the correct function in it.
i have checked both of your suggestions, i still get the same error.
the field with arguments to VM is empty. i added an argument with library path pointing to dll ( one relative to the working directory ). then i copied project/dist/dll to project/dll ( so netbeans can find it when compiling 'cause then the working dir is project/ and not project/dist ). when i compile and run from netbeans everything is fine.
Maybe it is a version mismatch… in other words, the lwjgl.dll version is not the one jME is expecting… try downloading the CVS version again and start from scratch. (I know it is not pleasant, but I have no more ideas).