Java JVM is 64 Bit is64BitJVM()

Here you can find the source of is64BitJVM()

Description

Takes an educated guess as to whether 64 bits are supported by the JVM.

License

Open Source License

Return

true if 64-bit support detected, false otherwise

Declaration

public static boolean is64BitJVM() 

Method Source Code

//package com.java2s;

public class Main {
    private static volatile boolean IS_64_BITNESS_KNOWN;
    private static volatile boolean IS_64_BIT_JVM;

    /**/*from  w  ww  .j a va2s  .  c o  m*/
     * Takes an educated guess as to whether 64 bits are supported by the JVM.
     * @return <code>true</code> if 64-bit support detected, <code>false</code> otherwise
     */
    public static boolean is64BitJVM() {
        if (!IS_64_BITNESS_KNOWN) {
            String arch = System.getProperty("os.arch");
            String sunModel = System.getProperty("sun.arch.data.model");
            IS_64_BIT_JVM = "amd64".equals(arch) || "x86_64".equals(arch) || "ppc64".equals(arch)
                    || "64".equals(sunModel);
            IS_64_BITNESS_KNOWN = true;
        }
        return IS_64_BIT_JVM;
    }
}

Related

  1. is64Bit()
  2. is64Bit()
  3. is64BitJavaOnMac()
  4. is64BitJavaOnMac()
  5. is64BitJre()
  6. is64bitJVM()
  7. is64BitJVM()