"java.lang.UnsatisfiedLinkError: no lwjgl in java"

Hi - first time JMonkey user here, need to use it for a class project due for friday week.



I am trying to set up JMonkey so I can write code on my laptop running Ubuntu 8.10 inside Eclipse. I am using JMonkey 2.0.



I originally got the error "java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path" when I tried to run a test project so I looked at the FAQ and did the following:


  1. copied the contents of jme/lib/natives to inside my workspace (/home/pete/workspace/cs1006-jmonkey/lib/natives where cs1006-jmonkey is the project folder)
  2. added -Djava.library.path="/home/pete/workspace/cs1006-jmonkey/lib/natives/" to the VM Arguments in the Run Dialog



    Now I get the following stack trace when I try to run the project:


Exception in thread "main" java.lang.NoClassDefFoundError: java/library/path=/home/pete/workspace/cs1006-jmonkey/lib/natives/
Caused by: java.lang.ClassNotFoundException: java.library.path=.home.pete.workspace.cs1006-jmonkey.lib.natives.
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: java.library.path=/home/pete/workspace/cs1006-jmonkey/lib/natives/.  Program will exit.



I am confused about what is wrong here - can someone please help me? I really need to start writing some code!!

Thanks :)
  • select your project directory from the package explorer inside the Eclipse IDE
  • right mouse click / Properties (select the properties of the project). The properties dialog should appear.
  • select "Java Build Path" entry on the left column
  • select the Libraries tab. The system shows a selector with all the jars used by the project
  • select the lwjgl library and expand that node, clicking on the small "+" icon on its left.
  • Click the "Native library location" child node. The system should display the "Native library folder configuration" dialog.
  • select the "Workspace" button and navigate your filesystem. Select the "native/myOS" directory that contains the lwjgl native libraries. Example for windows: "myJME2project/lib/native/win32". Press the ok button.
  • That value should be visible into the "Location path" field of the dialog. Press the ok button.



    Done ;^)


Great - thanks! :smiley:

Guys sorry to get back to this topic, but I am having a similar issue and after reaching the step:


  • select the “Workspace” button and navigate your filesystem. Select the “native/myOS” directory that contains the lwjgl native libraries. Example for windows: “myJME2project/lib/native/win32”. Press the ok button.



    I am lost here. If I click on workspace I am in the Eclipse package explorer and can’t tell what you mean by native/… the jme3 project does not even have a lib folder (I am connecting the jme3 jars externally as library files)