Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

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?

like image 602
u123 Avatar asked Jan 08 '11 23:01

u123


People also ask

How do I know if my JDK is 32 bit or 64 bit?

Go to the command prompt. Type "java -version" and press enter. If you are running Java 64-bit the output should include "64-Bit"


2 Answers

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.

like image 66
sjr Avatar answered Nov 13 '22 03:11

sjr


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

like image 27
Lukasz Avatar answered Nov 13 '22 03:11

Lukasz