how do i detect which version 32 or 64 bit Java is installed in Centos?

I am trying to detect which version of the java is running in my system (i mean i want to find out whether my java installation is 32 bit or 64 bit)

I have tried

$java -version 

which outputs following

java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.11.90)
(rhel-1.62.1.11.11.90.el6_4-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
  1. is this java 64bit install ?
  2. is this means java VM is running 64 bit or can it run on both mode ?
  3. If i has to install java 64 version as well, and setup the JAVA_HOME var to that path how to do this ?
  4. Long time ago (10 years ago) i did learn java, but those days we didnt had anything called java server like above, is this something different to normal JVM those days ?
  5. is in Centos can we run java as a Service ?

anyone who can help me, really appreciated.


Solution 1:

From a similar question on StackExchange:

You can try on the command line:

java -d64 -version

If it's not a 64-bit version, you'll get a message that looks like:

This Java instance does not support a 64-bit JVM. Please install the desired version.

Consult the help options of the JVM for more info java -help