NetBeans rejects jMonkeyEngine!

I followed the tutorial here:

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):

Jul 19, 2009 4:21:38 PM 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(
        at java.lang.Runtime.loadLibrary0(
        at java.lang.System.loadLibrary(
        at org.lwjgl.Sys$
        at Method)
        at org.lwjgl.Sys.doLoadLibrary(
        at org.lwjgl.Sys.loadLibrary(
        at org.lwjgl.Sys.<clinit>(
        at org.lwjgl.opengl.Display.<clinit>(
        at com.jme.system.lwjgl.LWJGLPropertiesDialog$
        at hello3d.test.HelloWorld.main(
Jul 19, 2009 4:21:38 PM 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 start
INFO: Application ending.
BUILD SUCCESSFUL (total time: 0 seconds)

Thanks in advance!


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: