Detect if running in a 64bit JVMTag(s): Environment
About cookies on this site
We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
public static boolean is64BitVM() {
String bits = System.getProperty("sun.arch.data.model", "?");
if (bits.equals("64") {
return true;
}
if (bits.equals("?") {
// probably sun.arch.data.model isn't available
// maybe not a Sun JVM?
// try with the vm.name property
return
System.getProperty("java.vm.name")
.toLowerCase().indexOf("64") >= 0;
}
// probably 32bit
return false;
}
}