English 中文(简体)
当没有指定 -d32 或 -d64 等选项时, 64位 JVM 会以 64 位模式运行吗?
原标题:Will a 64 bit JVM run in 64 bit mode when no option like -d32 or -d64 is specified
  • 时间:2012-05-22 06:39:23
  •  标签:
  • java
  • jvm

我在一个 64 位半人马机器上安装了 64 位 Java 。 我的查询是, 如果我不指定 - d64 选项, JVM 会以 32 位模式运行, 即使没有安装 32 位 JVM 吗?

我还有点好奇我们能否使用“javac”的 -d64 选项。如果是的话,那它意味着什么,或在哪里可以使用?我在阅读

问题回答

JRE 选择数据模型( 比特) 是为了将应用程序的运行限制在一个模式中运行。 java 字节代码设计为在两种数据模型中运行, 因此对于100%的纯 java 应用程序, 将根据每个架构的行为和效益来运行 。

但是,如果您的应用程序使用只使用一种模式的本地libs, 则该应用程序在不支持模式下将失败。 为此, 您必须明确指出它应该运行哪种模式 。

当设置 -d32 或 -d64 时, JRE 如果无法在选定模式下运行, 将不启动您的应用程序 < / strong> 。

从您链接到的甲骨文文档 :

我如何选择 32 和 64 位之间的操作? 默认值是什么?

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.

(强调地雷)

因此,根据您链接的文档,默认值是在32位 JRE中运行,并且可以通过 -J-d64 而不是简单的-d64 来运行64位 JRE中的 javac。

然而,请注意,该文件也说,它适用于爪哇1.4, 并说“对最近版本的爪哇一无所有





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...