FlagRush Beginner Help

Hello,



I'm having trouble trying to complete the first step of Lesson 2.



The code in the lesson says:

public static void main(String[] args) {
   Lesson2 app = new Lesson2();
   //We will load our own "fantastic" Flag Rush logo. Yes, I'm an artist.
   app.setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG, Lesson2.class.getClassLoader()
             .getResource("jmetest/data/images/FlagRush.png"));
   app.start();
}



But at the end, the whole code says:

   public static void main(String[] args) {
      Lesson2 app = new Lesson2();
      //We will load our own "fantastic" Flag Rush logo. Yes, I'm an artist.
      app.setConfigShowMode(ConfigShowMode.AlwaysShow,
                                      Lesson2.class.getResource("/res/FlagRush.png"));
      app.start();
   }



When using the first code the section "ALWAYS_SHOW_PROPS_DIALOG" is underlined red in Netbeans and will not compile. However, in the second one everything is fine but still doesn't compile.

I get the following error message with the second code:

run:
19-Sep-2009 14:13:35 com.jme.app.BaseGame start
INFO: Application started.
19-Sep-2009 14:13:36 com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
19-Sep-2009 14:13:36 com.jme.system.PropertiesGameSettings load
WARNING: Could not load properties. Creating a new one.
19-Sep-2009 14:13:37 class FlagRushPackage.FlagRush 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 FlagRushPackage.FlagRush.main(FlagRush.java:13)
19-Sep-2009 14:13:37 com.jme.app.BaseGame start
INFO: Application ending.
BUILD STOPPED (total time: 6 seconds)



Any help would be greatly appreciated.

As another note - I have tried other simple programs and they have worked fine so I don't think its the configuration.

Under Run, set the VM OPTIONS to:

-Djava.library.path="jME2jME2liblwjglnativewin32";


( I assume you use windows 32bit.)

btw.. you could read this in the wiki on this homepage ;)

Ah I didn't realise it needed to be done for each new project. Thanks.



Could you tell me why it only works with the second code though? Is the first code for jME v1?



Cheers again

Could you tell me why it only works with the second code though? Is the first code for jME v1?

Yes, you're right!
It's because jME moved from static integer fields to Enums!

Cheers!