public final class SystemUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
endsWithJavaPath(String jvmExecPath) |
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 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*null
if wrong path or directory layout of JDK installation.public static File toJdkHomeFromJre()
java.home
is /jdk
(since jdk9) or /jdk/jre
(prior to jdk9) then the absolute path to
JDK home is returned /jdk
.public static BigDecimal toJdkVersionFromReleaseFile(File jdkHome)
public static boolean isJava9AtLeast(String jvmExecutablePath)
public static boolean isBuiltInJava9AtLeast()
public static boolean isJava9AtLeast(BigDecimal version)
public static ClassLoader platformClassLoader()
public static Long pid()
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.