Can't run JME

So I started to work with it in NetBeans 6.7 I followed this tutorial to set it up

http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_netbeans_6.7_for_jme_2.0

and when I run it with this code:



package test;

import com.jme.app.SimpleGame;
import com.jme.math.Vector3f;
import com.jme.scene.shape.Box;

public class TestSphere extends SimpleGame {
    public static void main(String[] args) {   
        TestSphere app = new TestSphere();
        app.setConfigShowMode(ConfigShowMode.AlwaysShow);
        app.start();
    
    }
    @Override
    protected void simpleInitGame() {
        Box b = new Box("My box",new Vector3f(0,0,0),new Vector3f(1,1,1));// Make a box
        rootNode.attachChild(b);// Put it in the scene graph
    }
}




I always get this error:



30-Jul-2009 8:41:29 AM com.jme.app.BaseGame start
INFO: Application started.
30-Jul-2009 8:41:29 AM com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
30-Jul-2009 8:41:29 AM com.jme.system.PropertiesGameSettings load
WARNING: Could not load properties. Creating a new one.
30-Jul-2009 8:41:30 AM class test.TestSphere 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:1030)
        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 test.TestSphere.main(TestSphere.java:11)
30-Jul-2009 8:41:30 AM com.jme.app.BaseSimpleGame cleanup
INFO: Cleaning up resources.
30-Jul-2009 8:41:30 AM com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
30-Jul-2009 8:41:30 AM com.jme.app.BaseGame start
INFO: Application ending.




If someone can help me set it up I would be greatful. Thanks

i don't use netbeans, but in eclipse you need to set a native library path for the lwjgl.jar, which tells it  where the lwjgl.dll can be found.



Having a look on the netbeans tutorial, i guess you should recheck this step:


Next we add all native dynamic libraries to the Java Library Path:

  1.
     In the Project window, right-click your project and choose Properties from the context-menu.
        1.
           Go to the Run category of the Properties window.
        2.
           VM Options: Enter into the VM Options field where to find the native libraries.

           -Djava.library.path="../JME2/jME_2.0_Complete_(r4093)/lib/natives/"

  2.
     Close the Properties window.
  3.
     Your project is now set up to run an applications built with the jME framework.

Hha I did and I got it working I saw the graw box.





Now I have a new problem when I was working with a test file on of the imports in it, NetBeans claims I do not have it



import com.jme.scene.state.AlphaState;

Netbeans is right, you dont have it - that was from JME1 :slight_smile:



See the wiki for how to update JME1 code to JME2



http://www.jmonkeyengine.com/wiki/doku.php?id=jme_to_jme2_changes

AlphaState is a class belonging to jme1.

… it's suggestet to work with jme2 nowadays… but that just by the way.



what causes your error is a missing import of the class alphastate or you try to use old jme1 code with your netbeans project which is setup for jm2. so it can't find a class alphastate… its not there of course.