是否可以通过参数“-d32”强制 64 位 JVM 使用 32 位模式?
所以我有一些第 3 方本机库,只能在 Windows、OSX、Linux 上的 32 位 JVM 中工作,并且我需要始终强制 Java 应用程序在 32 位 JVM 模式下运行。
如果目标系统只安装了 64 位 JVM,是否可以强制其以 32 位模式运行 java 应用程序?
so I have some 3rd party native library that works only in 32 bit JVM across windows,osx,linux and I need to always enforce the java application to run in 32 bit JVM mode.
What about if the target system only has 64-bit JVM installed, would it be possible to force it to run the java application in 32 bit mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不。
您指定的先决条件禁止(好吧,我排除捆绑 JVM 解决方案和安装 JVM 解决方案)应用程序在 32 位 JRE 中运行。如果您想在 32 位 JVM 中运行应用程序,并且您的第三方本机库仅作为 32 位 DLL 提供,那么您必须使用 32 位 JVM。 64位JVM无法加载32位库;没有 32 位模式来加载此类库。
解决方案包括:
No.
The preconditions that you specified prohibit (okay, I'm precluding the bundle-the-JVM solution and install-the-JVM solution) the application from running in a 32-bit JRE. If you want to run your application in a 32-bit JVM, and your third party native library is only available as a 32-bit DLL, then you must use a 32-bit JVM. A 64-bit JVM cannot load the 32-bit library; there is no 32-bit mode to load such libraries.
Solutions include:
对于 Java 6,不行。对于 Java 7+,是的。
将 -d32 与 Java 7 一起使用
With Java 6, no. With Java 7+, yes.
Use -d32 with Java 7
由于
java
命令没有这样的参数,因此答案显然是否定的。As there is no such argument to the
java
command, the answer is obviously 'no'.