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

Method getJREs

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

Returns all public and private JREs of a given bitness (32 or 64). Windows: search in \Java typical 64-bit jdk: Program Files\Java\jdkX.X.X_XX\jre\bin\javaw.exe typical 64-bit jre: Program Files\Java\jreX.X.X_XX\bin\javaw.exe or Program Files\Java\jreX\bin\javaw.exe or Program Files\Java\jre-X\bin\

(int vmBitness)

Source from the content-addressed store, hash-verified

126 * @return a Set of java JRE directory paths
127 */
128 public TreeSet<File> getJREs(int vmBitness) {
129 TreeSet<File> results = findJREs();
130 for (Iterator<File> it = results.iterator(); it.hasNext();) {
131 String path = it.next().getPath();
132 if (vmBitness == 32 && !is32BitVM(path)) {
133 it.remove();
134 } else if (vmBitness != 32 && is32BitVM(path)) {
135 it.remove();
136 }
137 }
138 return results;
139 }
140
141 /**
142 * Finds the default JRE of a given bitness (32 or 64). A public JRE is returned

Callers 2

getDefaultJREMethod · 0.95
getPublicJREsMethod · 0.95

Calls 6

findJREsMethod · 0.95
is32BitVMMethod · 0.95
removeMethod · 0.65
hasNextMethod · 0.45
getPathMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected