How to run 64-bit

After the latest change http://www.jmonkeyengine.com/jmeforum/index.php?topic=10946.0 I tried my game in 64 bit and it worked fine inside Eclipse. But I cannot get it working when packing it into a fat jar and trying to run it from outside eclipse. This is the error I get:


C:UsersHaladriaDesktopTest>java -jar ImperiiFat64.jar
Imperii Started
2009-apr-19 16:18:46 com.jmex.game.DefaultUncaughtExceptionHandler uncaughtExcep
tion
ALLVARLIG: Main game loop broken by uncaught exception
java.lang.UnsatisfiedLinkError: C:UsersHaladriaDesktopTestlwjgl.dll: Can't
load IA 32-bit .dll on a AMD 64-bit platform
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        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.LWJGLDisplaySystem.setTitle(LWJGLDisplaySystem.j
ava:117)
        at com.jmex.game.StandardGame.initSystem(StandardGame.java:290)
        at com.jmex.game.StandardGame.run(StandardGame.java:210)
        at java.lang.Thread.run(Unknown Source)



I have copied the dll's (both 32 and 64 bit) to the same folder as I am executing this command from. And the game works fine if I use the 32-bit version of java. Do I need to do something more to get this working?

The error message says that it tries to run the 32 bit version but why? Can I configure that somewhere?

can you try without the 32 bit dll ?

Yes, here's the error I get when I don't have the 32 bit dll:


C:UsersHaladriaDesktopTest>java -jar ImperiiFat64.jar
Imperii Started
2009-apr-19 19:44:55 com.jmex.game.DefaultUncaughtExceptionHandler uncaughtExcep
tion
ALLVARLIG: Main game loop broken by uncaught exception
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.LWJGLDisplaySystem.setTitle(LWJGLDisplaySystem.j
ava:117)
        at com.jmex.game.StandardGame.initSystem(StandardGame.java:290)
        at com.jmex.game.StandardGame.run(StandardGame.java:210)
        at java.lang.Thread.run(Unknown Source)

see also this thread: http://lwjgl.org/forum/index.php/topic,2860.0.html



Are you running a 64 bit VM?

I have both 32 bit and 64 bit installed. Running the 32 bit works fine, but when trying to run with the 64-bit VM I get the error as posted.



I will read that thread, thanks for the link.

I solved it. It relied on the enviromental variables on the computer. So after changing the CLASSPATH, JAVA_HOME and PATH to point to the 64 bit version of the JDK I can now run it. But this is dangerous, I cannot rely on that the users have this set correctly!?



I will later try out which one of these enviromental variables that it depends on, if it's not all of them.