Exception

When I start the following program



import com.jme.app.SimpleGame;
 
public class Main extends SimpleGame {
 
   public static void main(String[] args) {
      Main main = new Main();
      main.setConfigShowMode(ConfigShowMode.ShowIfNoConfig);
      main.start();
   }
 
   protected void simpleInitGame() {
 
   }
 
}



There is this exception in eclipse:

27.06.2009 12:51:04 com.jme.app.BaseGame start
INFO: Application started.
27.06.2009 12:51:04 com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
27.06.2009 12:51:04 com.jme.system.PropertiesGameSettings load
WARNUNG: Could not load properties. Creating a new one.
27.06.2009 12:51:05 class Main start()
SCHWERWIEGEND: Exception in game loop
java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
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 Main.main(Main.java:8)
27.06.2009 12:51:05 com.jme.app.BaseSimpleGame cleanup
INFO: Cleaning up resources.
27.06.2009 12:51:05 com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
27.06.2009 12:51:05 com.jme.app.BaseGame start
INFO: Application ending.


whats wrong?

Search the forum for "no lwjgl in java.library.path" it should turn up about a million hits :slight_smile:

Maybe someone should change the error message to include the solution… since nearly everyone fails on this the first time.

i think that would have to happen in the lwjgl code then.

Catch the UnsatisfiedLinkError exception and throw a new one with a better message.

Well as generally its newbies who fall foul of this, maybe tacking an exception handler onto the end of the getAttributes method in abstractGame?  Seems to work ok, maybe a less sarcastic message, but I've been watching a lot of House MD lately  :smiley:



} catch (InterruptedException e) {
    logger.warning( "Error waiting for dialog system, using defaults.");
} catch (UnsatisfiedLinkError t){
    if( t.getLocalizedMessage()!=null && t.getLocalizedMessage().contains("java.library.path") ){
        logger.severe("nn  Use the forum Luke - search it for UnsatisfiedLinkError n");
    }
    t.printStackTrace();
} catch (Throwable t){
    t.printStackTrace();
}


That can't hurt



But I don't know if the warning helps that much.

WARNUNG: java.library.path seems to be not or wrongly set. It should probaly be set to lib/lwjgl/natve/<os>
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
..
..

Maybe display a direct URL to a forum/wiki page with the appropriate solution ?