Package org.apache.maven.surefire.booter
Class SystemUtils
java.lang.Object
org.apache.maven.surefire.booter.SystemUtils
JDK 9 support.
- Since:
- 2.20.1
- Author:
- Tibor Digana (tibor17)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanendsWithJavaPath(String jvmExecPath) static booleanstatic booleanstatic booleanisJava9AtLeast(String jvmExecutablePath) static booleanisJava9AtLeast(BigDecimal version) static Longpid()static ClassLoaderstatic FileIf system property java.home is /jdk (since jdk9) or /jdk/jre (prior to jdk9) then the absolute path to JDK home is returned /jdk.static FiletoJdkHomeFromJvmExec(String jvmExecutable) IfjvmExecutableis /jdk/bin/java (since jdk9) or /jdk/jre/bin/java (prior to jdk9) then the absolute path to JDK home is returned /jdk.static BigDecimaltoJdkVersionFromReleaseFile(File jdkHome)
-
Field Details
-
JAVA_SPECIFICATION_VERSION
-
-
Method Details
-
endsWithJavaPath
- Parameters:
jvmExecPath- e.g. /jdk/bin/java, /jdk/jre/bin/java- Returns:
trueifjvmExecPathis path to java binary executor
-
toJdkHomeFromJvmExec
IfjvmExecutableis /jdk/bin/java (since jdk9) or /jdk/jre/bin/java (prior to jdk9) then the absolute path to JDK home is returned /jdk.
Null is returned ifjvmExecutableis incorrect.- Parameters:
jvmExecutable- /jdk/bin/java* or /jdk/jre/bin/java*- Returns:
- path to jdk directory; or null if wrong path or directory layout of JDK installation.
-
toJdkHomeFromJre
If system property java.home is /jdk (since jdk9) or /jdk/jre (prior to jdk9) then the absolute path to JDK home is returned /jdk.- Returns:
- path to JDK
-
toJdkVersionFromReleaseFile
-
isJava9AtLeast
-
isBuiltInJava9AtLeast
public static boolean isBuiltInJava9AtLeast() -
isBuiltInJava7AtLeast
public static boolean isBuiltInJava7AtLeast() -
isJava9AtLeast
-
platformClassLoader
-
pid
-