我需要在 windows 8.1 64 位下以 32 位模式运行 java。
我已经在 c:\Program Files\Java\jre7
(64 位 JVM)和 c:\Program Files (x86)\Java\jre7
下安装了 java 7 jre >(32 位 JVM)。
但是,如果我从 cmd 发出 java -d32 -version
,我会收到此错误:
Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.
如果没有 -d32
开关,它会确认它正在运行 64 位 JVM:
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
所以我打开java控制面板,将32位JVM添加到用户安装的JRE中(系统选项卡不允许我更改任何内容,即使以管理员身份运行),但没有任何变化。
我读过一些用户的帖子说 java 7+ 应该支持 -d32
模式,但我无法理解。
注意:请注意,我无法删除 64 位 JVM,因为其他应用程序需要它
最佳答案
根据这个FAQ :
How do I select between 32 and 64-bit operation? What's the default?
The options -d32 and -d64 have been added to the Java launcher to specify whether the program is to be run in a 32 or 64-bit environment. On Solaris these correspond to the ILP32 and LP64 data models, respectively. Since Solaris has both a 32 and 64-bit J2SE implementation contained within the same installation of Java, you can specify either version. If neither -d32 nor -d64 is specified, the default is to run in a 32-bit environment. Other Java commands (javac, javadoc, etc.) will rarely need to be executed in a 64-bit environment. However, the -d32/-d64 options may be passed to these commands and then on to the Java launcher using the established -J prefix option (eg: -J-d64).
All other platforms (Windows and Linux) contain separate 32 and 64-bit installation packages. If both packages are installed on a system, you select one or the other by adding the appropriate "bin" directory to your path. For consistency, the Java implementations on Linux accept the -d64 option.
关于java - 在 Windows 64 上以 32 位模式运行 java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24009725/