MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / is32BitVM

Method is32BitVM

src/org/opensourcephysics/tools/JREFinder.java:85–105  ·  view source on GitHub ↗

Determines if a JRE path points to a 32-bit VM. @param jrePath the JRE path @return true if 32-bit

(String jrePath)

Source from the content-addressed store, hash-verified

83 * @return true if 32-bit
84 */
85 public boolean is32BitVM(String jrePath) {
86 if (jrePath == null)
87 return false;
88 if (OSPRuntime.isWindows()) {
89 // this will identify bundled 64bit jre
90 if (jrePath.contains("64"))
91 return false;
92 String x86 = System.getenv("ProgramFiles(x86)"); //$NON-NLS-1$
93 if (x86 != null) {
94 return jrePath.contains(x86) ? true : false;
95 }
96 // must be 32-bit?
97 return true;
98 }
99 if (OSPRuntime.isMac()) {
100 // no OSX VMs can be run in 32-bit mode?
101 return false;
102 }
103 // on linux, assume all JREs have same bitness as current VM?
104 return OSPRuntime.getVMBitness() == 32;
105 }
106
107 /**
108 * Returns all public and private JREs of a given bitness (32 or 64).

Callers 2

getJREsMethod · 0.95
getDefaultJREMethod · 0.95

Calls 4

isWindowsMethod · 0.95
isMacMethod · 0.95
getVMBitnessMethod · 0.95
containsMethod · 0.65

Tested by

no test coverage detected