@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class JavaUtils extends Object
Modifier and Type | Method and Description |
---|---|
static io.jenkins.lib.versionnumber.JavaSpecificationVersion |
getCurrentJavaRuntimeVersionNumber()
Returns the JVM's current version as a
VersionNumber instance. |
static String |
getCurrentRuntimeJavaVersion()
Returns the JVM's current version as a
String . |
static boolean |
isRunningWithJava8OrBelow()
Check whether the current JVM is running with Java 8 or below
|
static boolean |
isRunningWithPostJava8()
Check whether the current JVM is running with Java 9 or above.
|
public static boolean isRunningWithJava8OrBelow()
true
if it is Java 8 or older versionpublic static boolean isRunningWithPostJava8()
true
if it is Java 9 or abovepublic static io.jenkins.lib.versionnumber.JavaSpecificationVersion getCurrentJavaRuntimeVersionNumber()
VersionNumber
instance.public static String getCurrentRuntimeJavaVersion()
String
.
See https://openjdk.java.net/jeps/223 for the expected format.
1.x
System.getProperty(String)
Copyright © 2004–2021. All rights reserved.