Sunday, June 2, 2013

how to check if the jre/jdk is a 64 bits jre/jdk ?


solution :

Using -d64, the jre/jdk will report an error in the case it is not a 64 bits version.

rudy@vostro:~/opt/jdk1.7.0_17/bin$ ./java -d64 version
Error: This Java instance does not support a 64-bit JVM.
Please install the desired version.


rudy@vostro:~/opt/jdk1.7.0_06/bin$ ./java -d64 version
Error: Could not find or load main class version


By the way :-) It is also written in the message that is returned :-)


rudy@vostro:~/opt/jdk1.7.0_21/bin$ ./java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)