Starting a jar with double click starts in 32bit JVM, but from console in 64bit JVM

◇◆丶佛笑我妖孽 提交于 2019-12-10 15:56:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!