Package com.google.gson.internal
Class JavaVersion
- java.lang.Object
-
- com.google.gson.internal.JavaVersion
-
public final class JavaVersion extends java.lang.ObjectUtility to check the major Java version of the current JVM.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetMajorJavaVersion()Gets the major Java versionstatic booleanisJava9OrLater()Gets a boolean value depending if the application is running on Java 9 or later
-
-
-
Method Detail
-
getMajorJavaVersion
public static int getMajorJavaVersion()
Gets the major Java version- Returns:
- the major Java version, i.e. '8' for Java 1.8, '9' for Java 9 etc.
-
isJava9OrLater
public static boolean isJava9OrLater()
Gets a boolean value depending if the application is running on Java 9 or later- Returns:
trueif the application is running on Java 9 or later; andfalseotherwise.
-
-