public final class SystemUtils extends Object
Modifier and Type | Field and Description |
---|---|
static BigDecimal |
JAVA_SPECIFICATION_VERSION |
Modifier and Type | Method and Description |
---|---|
static boolean |
endsWithJavaPath(String jvmExecPath) |
static boolean |
isBuiltInJava7AtLeast() |
static boolean |
isBuiltInJava9AtLeast() |
static boolean |
isJava9AtLeast(BigDecimal 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 BigDecimal |
toJdkVersionFromReleaseFile(File jdkHome) |
public static final BigDecimal JAVA_SPECIFICATION_VERSION
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 BigDecimal toJdkVersionFromReleaseFile(File jdkHome)
public static boolean isJava9AtLeast(String jvmExecutablePath)
public static boolean isBuiltInJava9AtLeast()
public static boolean isBuiltInJava7AtLeast()
public static boolean isJava9AtLeast(BigDecimal version)
public static ClassLoader platformClassLoader()
public static Long pid()
Copyright © 2004–2018 The Apache Software Foundation. All rights reserved.