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)
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
endsWithJavaPath
(String jvmExecPath) static boolean
static boolean
isJava9AtLeast
(String jvmExecutablePath) static boolean
isJava9AtLeast
(BigDecimal version) static Long
pid()
static ClassLoader
static File
If system propertyjava.home
is/jdk
(since jdk9) or/jdk/jre
(prior to jdk9) then the absolute path to JDK home is returned/jdk
.static File
toJdkHomeFromJvmExec
(String jvmExecutable) IfjvmExecutable
is/jdk/bin/java
(since jdk9) or/jdk/jre/bin/java
(prior to jdk9) then the absolute path to JDK home is returned/jdk
.static BigDecimal
toJdkVersionFromReleaseFile
(File jdkHome)
-
Method Details
-
endsWithJavaPath
- Parameters:
jvmExecPath
- e.g. /jdk/bin/java, /jdk/jre/bin/java- Returns:
true
ifjvmExecPath
is path to java binary executor
-
toJdkHomeFromJvmExec
IfjvmExecutable
is/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 ifjvmExecutable
is 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 propertyjava.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() -
isJava9AtLeast
-
platformClassLoader
-
pid
-