public final class SystemUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
endsWithJavaPath(String jvmExecPath) |
static boolean |
isJava9AtLeast(Double version) |
static boolean |
isJava9AtLeast(String jvmExecutablePath) |
static Long |
pid() |
static ClassLoader |
platformClassLoader() |
static File |
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.
|
static File |
toJdkHomeFromJvmExec(String jvmExecutable)
If
jvmExecutable 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 Double |
toJdkVersionFromReleaseFile(File jdkHome) |
public static boolean endsWithJavaPath(String jvmExecPath)
jvmExecPath
- e.g. /jdk/bin/java, /jdk/jre/bin/javatrue
if jvmExecPath
is path to java binary executorpublic static File toJdkHomeFromJvmExec(String jvmExecutable)
jvmExecutable
is /jdk/bin/java (since jdk9) or /jdk/jre/bin/java (prior to jdk9)
then the absolute path to JDK home is returned /jdk.
jvmExecutable
is incorrect.jvmExecutable
- /jdk/bin/java* or /jdk/jre/bin/java*public static File toJdkHomeFromJre()
public static boolean isJava9AtLeast(String jvmExecutablePath)
public static boolean isJava9AtLeast(Double version)
public static ClassLoader platformClassLoader()
public static Long pid()
Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.