检测 Java 是否运行在64bit 的JVM上,64bitjvm, public s
分享于 点击 42335 次 点评:173
检测 Java 是否运行在64bit 的JVM上,64bitjvm, public s
public static boolean is64BitVM() { String bits = System.getProperty("sun.arch.data.model"); if (bits != null) { return bits.equals("64"); } else { // 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").contains("64"); } }
用户点评