How to check java bit version on Linux?

Possible duplicate:
installed jvm 64-bit or 32-bit

How to check which version of Java bits 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 it 32-bit or 64-bit?

+8
java linux
source share
4 answers

Run java with the specified -d64 or -d32 , this will give you an error message if it does not support 64-bit or 32-bit, respectively. Your JVM can support both.

+19
source share

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

+1
source share

Go to this JVM online test and run it.

Then check the displayed architecture: x86_64 means you have a 64-bit version installed, otherwise it will be 32-bit.

0
source share

Works for every binary, not just java:

 file - < $(which java) # heavyly bashic cat `which java` | file - # universal 
0
source share

Source: https://habr.com/ru/post/650845/


All Articles