Package org.opensourcephysics.tools
Class JREFinder
java.lang.Object
org.opensourcephysics.tools.JREFinder
JREFinder finds Java JRE directories.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Method Summary
Modifier and TypeMethodDescriptiongetDefaultJRE
(int vmBitness, String path, boolean searchAll) Finds the default JRE of a given bitness (32 or 64).static JREFinder
Gets the singleton JREFinder.getJREs
(int vmBitness) Returns all public and private JREs of a given bitness (32 or 64).boolean
Determines if a JRE path points to a 32-bit VM.static boolean
isReady()
-
Method Details
-
getFinder
Gets the singleton JREFinder.- Returns:
- the JREFinder
-
isReady
public static boolean isReady() -
is32BitVM
Determines if a JRE path points to a 32-bit VM.- Parameters:
jrePath
- the JRE path- Returns:
- true if 32-bit
-
getJREs
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\javaw.exe typical 32-bit jre: as above, but in Program Files (x86)\Java\ OS X: search in: /JavaVirtualMachines typical: /System/Library/Java/JavaVirtualMachines/X.X.X.jdk/Contents/Home/bin/javaw.exe ?? Linux: search in: /jvm typical: /usr/lib/jvm/java-X-openjdk/jre/bin/javaw.exe or /usr/lib/jvm/java-X.X.X-openjdk/jre/bin/javaw.exe or /usr/lib/jvm/java-X-sun-X.X.X.XX/jre/bin/javaw.exe or /usr/lib/jvm/java-X.X.X-sun/jre/bin/javaw.exe- Parameters:
vmBitness
- the bitness desired- Returns:
- a Set of java JRE directory paths
-
getDefaultJRE
Finds the default JRE of a given bitness (32 or 64). A public JRE is returned if possible.- Parameters:
vmBitness
- the bitness desiredpath
- the first path to search for a JRE--if found, return as defaultsearchAll
- true to search paths other than the specified one- Returns:
- the default JRE directory, or null if none found
-