我在下面的内容摘自
JDK FAQ’s
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.
现在测试一下,我登录到我的64位Ubuntu客户操作系统并安装了64位JDK版本 – Linux x64 165.24 MB jdk-8u45-linux-x64.tar.gz.
安装JDK后,当我使用-d64运行我的java程序时,一切都按预期进行,因为它实际上是64位安装,但是当我使用-d32时,我得到错误说错误 – 这个Java实例不支持32位JVM .
错误对我来说是可以理解的,但令我困惑的是这一行(如上面引用的段落中所述)“选项-d32和-d64已被添加到Java启动程序中以指定程序是以32或64运行 – 位环境.“
根据这一行,我的理解是,当启动64位版本的Java时,-d32可用于以32位模式启动它.
问题:
>我的理解是否正确?如果它是正确的,那么我收到错误?
>如果我的理解不正确,那么为什么我需要这些命令行参数,因为当我使用java启动Java时,我的PATH中的任何安装(32位或64位JDK)都将被启动.