问题
Since I'm using native libraries I have different JARs for 32bit and 64bit platforms. Now when there are two JVMs installed on the system, one 32bit and one 64bit I face this behaviour:
Double clicking the 32bit JAR -> works
Double clicking the 64bit JAR -> App doesn't start
Starting the 32bit JAR from console -> Error: This Java instance does not support a 32-bit JVM.Please install the desired version.
Starting the 64bit JAR from console -> works
On Mac I can start the 32bit JAR from console, when adding -d32 to the command. But on Windows, this doesn't work.
I expect, that on a system, where a 64bit JVM is installed, the JAR should start in 64bit JVM, no matter if started by double click or via console.
I there a way to accomplish that?
回答1:
Check where the PATH
environment variable points to. I think you will find that it points to your 64-bit JVM, as opposed to the default application associated with .jar
files, which will probably be a 32-bit JVM on your system. Align those two values, and you should be fine.
来源:https://stackoverflow.com/questions/14875368/starting-a-jar-with-double-click-starts-in-32bit-jvm-but-from-console-in-64bit