Class SystemJarFinder
java.lang.Object
nonapi.io.github.classgraph.classpath.SystemJarFinder
A class to find rt.jar and any JRE "lib/" or "ext/" jars.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe paths of any "lib/" or "ext/" jars found in the JRE.private static final String
The path of the first "rt.jar" found.The paths of any "rt.jar" files found in the JRE. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
addJREPath
(File dir) Add and search a JRE path.Get the JRE "lib/" and "ext/" jar paths.static String
Get the JRE "rt.jar" path.
-
Field Details
-
RT_JARS
The paths of any "rt.jar" files found in the JRE. -
RT_JAR
The path of the first "rt.jar" found. -
JRE_LIB_OR_EXT_JARS
The paths of any "lib/" or "ext/" jars found in the JRE.
-
-
Constructor Details
-
SystemJarFinder
private SystemJarFinder()Constructor.
-
-
Method Details
-
addJREPath
Add and search a JRE path.- Parameters:
dir
- the JRE directory- Returns:
- true if the directory was readable.
-
getJreRtJarPath
Get the JRE "rt.jar" path.- Returns:
- The path of rt.jar (in JDK 7 or 8), or null if it wasn't found (e.g. in JDK 9+).
-
getJreLibOrExtJars
Get the JRE "lib/" and "ext/" jar paths.- Returns:
- The paths for any jarfiles found in JRE/JDK "lib/" or "ext/" directories.
-