NetBeans rejects jMonkeyEngine!

I followed the tutorial here: http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_netbeans_6.7_for_jme_2.0.



I did EVERYTHING twice, but to no avail.



Here is the error message, can anyone tell me what is says (and how to fix it :P):

run:
Jul 19, 2009 4:21:38 PM com.jme.app.BaseGame start
INFO: Application started.
Jul 19, 2009 4:21:38 PM com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
Jul 19, 2009 4:21:38 PM com.jme.system.PropertiesGameSettings load
WARNING: Could not load properties. Creating a new one.
Jul 19, 2009 4:21:38 PM class hello3d.test.HelloWorld start()
SEVERE: Exception in game loop
java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1028)
        at org.lwjgl.Sys$1.run(Sys.java:72)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)
        at org.lwjgl.Sys.loadLibrary(Sys.java:81)
        at org.lwjgl.Sys.<clinit>(Sys.java:98)
        at org.lwjgl.opengl.Display.<clinit>(Display.java:129)
        at com.jme.system.lwjgl.LWJGLPropertiesDialog$ModesRetriever.run(LWJGLPropertiesDialog.java:682)
        at com.jme.app.AbstractGame.getAttributes(AbstractGame.java:252)
        at com.jme.app.BaseGame.start(BaseGame.java:67)
        at hello3d.test.HelloWorld.main(HelloWorld.java:12)
Jul 19, 2009 4:21:38 PM com.jme.app.BaseSimpleGame cleanup
INFO: Cleaning up resources.
Jul 19, 2009 4:21:38 PM com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
Jul 19, 2009 4:21:38 PM com.jme.app.BaseGame start
INFO: Application ending.
BUILD SUCCESSFUL (total time: 0 seconds)



Thanks in advance!

hi,



i'm a really newbie, but using eclipse you have to set the "native library location" of lwjgl to "jme/lib/lwjgl/native/<your OS>".

this error just sounds like he can't find the lwjgl.

i hope this helps.

An additional point: While I'm also far more familiar with Eclipse than Netbeans, the bug you're posting looks very much like the VM being created to run HelloWorld in, rather than the JME project's VM, is the one which isn't finding the native libraries.



In other words, setting the native library parameters as shown in the tutorial is enough to allow you to build the JME project and successfully compile your own projects to use JME. However, that alone might not mean that when you try to run your project, the VM Netbeans creates to run it in will also know where those native libraries are.



When running your JME-based application from a command line, you'd need to run it as "java  -Djava.library.path=[drive letter and path ending in jmeliblwjglnative<your OS>] [your application's main class] [your application's arguments]" (assuming you're not using a more complicated application packaging system). There should be a way to pass the same argument into Netbeans for running your app's main class. In Eclipse I know this can be done under the "Run Configurations…" dialog accessible off of the "Run" menu. I'm not sure what the Netbeans equivalent is.

i'm having the same problem, and i put this option on JVM -Djava.library.path="C:UsersAndreiJMEJMonkeyEngineCompletejmelibnatives", add all jars and still not working…



I'm using Netbeans 6.7, jdk 1.6  windows vista…



furthermore, the zip file that i downloaded, the folder natives, doesnt have any other folder, only files…

I wrote that… :slight_smile: I can improve it for future readers if you give me feedback what was unclear.



This Java error message is famously very unclear and not helpful, but I do mention the java library path in the text already. It says that the JVM cannot find various native libraries (starting with lwjgl.dll, but likely also others) that jmonkey relies on. It's the most common error and I think everybody gets it at first.



So you must set the java library path to point to where you downloaded the native libraries to fix this. In NetBeans, did you add your path under "Project properties > Run > VM Options" as it says? The most common issues are the quotation marks, using the right syntax, and typos in the path! (People reported that copying an pasting the quotes from the wiki copies curly "literature and arts" quotes instead of normal "computer science" quotes.)



@Deiome: You are right, the native folder is not split up into subfolders (I fixed that in the intro text). But that doesn't make any difference for the rest of the steps in the tutorial. :wink:



@DanaO: What you say about the command line is true, I mention this in the end of section 3, and in section 6. But if you think what I wrote is not clear, again, please point it out to me, and I'll improve it. It's supposed to answer questions, not raise new ones. :wink: