Saturday, 19 July 2014

How to check 64bit or 32 bit JVM

1. You can call the command 'java -version' and you can get the details.

C:\>java -version
java version "1.7.0_13"
Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

Output of the above command tells about the bit mode of your JVM.

2. Sun has a Java System property to determine the bitness of the JVM: 32 or 64:
sun.arch.data.model=32 // 32 bit JVM
sun.arch.data.model=64 // 64 bit JVM

public class GetJVMBitSize {
    public static void main(String args[]){
        String bitMode = System.getProperty("sun.arch.data.model");
        System.out.println("JVM bit size " + bitMode);
    }
}



                                                             Home

No comments:

Post a Comment