如何检查Linux上的java位版本? [重复]

时间:2021-07-31 20:30:13

Possible Duplicate:
installed jvm is 64 bit or 32 bit

可能重复:安装的jvm是64位或32位

How do I check which bit version of Java is installed on my linux machine? When I type:

如何检查我的linux机器上安装了哪个位版本的Java?当我输入:

java -version

I get:

我明白了:

java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)

Is that 32bit or 64bit?

是32位还是64位?

4 个解决方案

#1


19  

Run java with -d64 or -d32 specified, it will give you an error message if it doesn't support 64-bit or 32-bit respectively. Your JVM may support both.

使用指定的-d64或-d32运行java,如果它不支持64位或32位,它将给出错误消息。您的JVM可能同时支持两者。

#2


1  

Why don't you examine System.getProperty("os.arch") value in your code?

为什么不检查代码中的System.getProperty(“os.arch”)值?

#3


0  

Go to this JVM online test and run it.

转到此JVM在线测试并运行它。

Then check the architecture displayed: x86_64 means you have the 64bit version installed, otherwise it's 32bit.

然后检查显示的体系结构:x86_64表示您已安装64位版本,否则为32位。

#4


0  

Works for every binary, not only java:

适用于每个二进制文件,而不仅仅是java:

file - < $(which java) # heavyly bashic

cat `which java` | file - # universal

#1


19  

Run java with -d64 or -d32 specified, it will give you an error message if it doesn't support 64-bit or 32-bit respectively. Your JVM may support both.

使用指定的-d64或-d32运行java,如果它不支持64位或32位,它将给出错误消息。您的JVM可能同时支持两者。

#2


1  

Why don't you examine System.getProperty("os.arch") value in your code?

为什么不检查代码中的System.getProperty(“os.arch”)值?

#3


0  

Go to this JVM online test and run it.

转到此JVM在线测试并运行它。

Then check the architecture displayed: x86_64 means you have the 64bit version installed, otherwise it's 32bit.

然后检查显示的体系结构:x86_64表示您已安装64位版本,否则为32位。

#4


0  

Works for every binary, not only java:

适用于每个二进制文件,而不仅仅是java:

file - < $(which java) # heavyly bashic

cat `which java` | file - # universal