Java Utililty Methods OS is 64 Bit

List of utility methods to do OS is 64 Bit

Description

The list of methods to do OS is 64 Bit are organized into topic(s).

Method

booleanis64()
is
if (isWindows()) {
    return (System.getenv("ProgramW6432") != null);
} else {
    return !getOSBits().equals("x86");
booleanis64()
Return true, if running on 64bit Windows.
final String keys[] = { "sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch" };
for (String key : keys) {
    String property = System.getProperty(key);
    if (property != null) {
        return (property.indexOf("64") >= 0);
return false;
...
booleanis64()
is
return System.getProperty("os.arch").contains("64");
booleanis64Bit(String arch)
is Bit
if (arch.equals("x86"))
    return false;
else if (arch.equals("amd64"))
    return true;
else if (arch.equals("x86_64"))
    return true;
else if (arch.equals("ppc") || arch.equals("PowerPC"))
    return false;
...
booleanis64BitArchitecture()
Returns true if the current system has a 64bit architecture.
if (isRunningWindows()) {
    return "AMD64".equals(System.getenv("PROCESSOR_ARCHITECTURE"))
            || "AMD64".equals(System.getenv("PROCESSOR_ARCHITEW6432"));
throw new RuntimeException("Not implememted for Linux or Mac yet.");
booleanis64BitOs()
is Bit Os
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
if (arch == null) {
    return false;
return arch.endsWith("64") || wow64Arch != null && wow64Arch.endsWith("64");
booleanis64BitOS()
Attempts to determine whether the operating system is a 64-bit operating system.
if (System.getProperty("os.name").contains("Windows")) { 
    return (System.getenv("ProgramFiles(x86)") != null); 
} else {
    return (System.getProperty("os.arch").contains("64")); 
booleanis64bitOS()
isbit OS
return getOSArch().contains("64");
booleanis64BitOs()
is Bit Os
return System.getProperty("java.vm.name").indexOf("64") >= 0;
booleanis64bitPlatform()
isbit Platform
return System.getProperty("os.arch").indexOf("64") >= 0;