[java] How to check java bit version on Linux?

Possible Duplicate:
installed jvm is 64 bit or 32 bit

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

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?

This question is related to java linux

The answer is


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


Works for every binary, not only java:

file - < $(which java) # heavyly bashic

cat `which java` | file - # universal

Go to this JVM online test and run it.

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