public abstract class JdkVersion extends Object
Modifier and Type | Field and Description |
---|---|
static int |
JAVA_13
Constant identifying the 1.3.x JVM (JDK 1.3).
|
static int |
JAVA_14
Constant identifying the 1.4.x JVM (J2SE 1.4).
|
static int |
JAVA_15
Constant identifying the 1.5 JVM (Java 5).
|
static int |
JAVA_16
Constant identifying the 1.6 JVM (Java 6).
|
static int |
JAVA_17
Constant identifying the 1.7 JVM (Java 7).
|
static int |
JAVA_18
Constant identifying the 1.8 JVM (Java 8).
|
static int |
JAVA_19
Constant identifying the 1.9 JVM (Java 9).
|
Constructor and Description |
---|
JdkVersion() |
Modifier and Type | Method and Description |
---|---|
static String |
getJavaVersion()
Return the full Java version string, as returned by
System.getProperty("java.version") . |
static int |
getMajorJavaVersion()
Get the major version code.
|
static boolean |
isAtLeastJava14()
Convenience method to determine if the current JVM is at least Java 1.4.
|
static boolean |
isAtLeastJava15()
Convenience method to determine if the current JVM is at least Java 1.5 (Java 5).
|
static boolean |
isAtLeastJava16()
Convenience method to determine if the current JVM is at least Java 1.6 (Java 6).
|
static boolean |
isAtLeastJava17()
Convenience method to determine if the current JVM is at least Java 1.7 (Java 7).
|
static boolean |
isAtLeastJava18()
Convenience method to determine if the current JVM is at least Java 1.8 (Java 8).
|
static boolean |
isAtLeastJava19()
Convenience method to determine if the current JVM is at least Java 1.9 (Java 9).
|
public static final int JAVA_13
public static final int JAVA_14
public static final int JAVA_15
public static final int JAVA_16
public static final int JAVA_17
public static final int JAVA_18
public static final int JAVA_19
public static String getJavaVersion()
System.getProperty("java.version")
.System.getProperty(String)
public static int getMajorJavaVersion()
if (getMajorJavaVersion()
< JAVA_14)
.public static boolean isAtLeastJava14()
public static boolean isAtLeastJava15()
public static boolean isAtLeastJava16()
true
if the current JVM is at least Java 1.6getMajorJavaVersion()
,
JAVA_16
,
JAVA_17
,
JAVA_18
,
JAVA_19
public static boolean isAtLeastJava17()
true
if the current JVM is at least Java 1.7getMajorJavaVersion()
,
JAVA_17
,
JAVA_18
,
JAVA_19
public static boolean isAtLeastJava18()
true
if the current JVM is at least Java 1.8getMajorJavaVersion()
,
JAVA_18
,
JAVA_19
public static boolean isAtLeastJava19()
true
if the current JVM is at least Java 1.9getMajorJavaVersion()
,
JAVA_19
Copyright © GigaSpaces.