public class JVMHelper
extends java.lang.Object
| Constructor and Description |
|---|
JVMHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
hasNativeAccess()
Should native access be attempted within the current JVM runtime
|
static boolean |
isJava17()
Returns true if the Java version is at least 17
Java 17 is used from 1.18.2 to 1.20.4
|
static boolean |
isJava17(boolean strict)
Returns true if the Java version is equal to or at least 17 depending on the strict flag.
|
static boolean |
isJava21()
Returns true if the Java version is at least 21.
|
static boolean |
isJava21(boolean strict)
Returns true if the Java version is equal to or at least 21 depending on the strict flag.
|
static boolean |
isJava25()
Returns true if the Java version is at least 25.
|
static boolean |
isJava25(boolean strict)
Returns true if the Java version is equal to or at least 25 depending on the strict flag.
|
static boolean |
isJava8()
Returns true if the Java version is equal to 8.
|
static boolean |
isJava8(boolean strict)
Returns true if the Java version is equal to or at least 8 depending on the strict flag.
|
static boolean |
isVersion(int version)
Returns true if the current Java version is equal to the input version
|
static boolean |
isVersionAtLeast(int version)
Returns true if the current Java version is at least the input version
|
static boolean |
isVersionAtMost(int version)
Returns true if the current Java version is at most the input version
|
static boolean |
isVersionGreaterThan(int version)
Returns true if the current Java version is greater than the input version
|
static boolean |
isVersionLessThan(int version)
Returns true if the current Java version is less than input version
|
static int |
version()
Should return 8, 17, 21, 25, etc.
|
public static boolean hasNativeAccess()
public static boolean isJava8()
public static boolean isJava8(boolean strict)
public static boolean isJava17()
public static boolean isJava17(boolean strict)
public static boolean isJava21()
public static boolean isJava21(boolean strict)
public static boolean isJava25()
public static boolean isJava25(boolean strict)
public static boolean isVersion(int version)
public static boolean isVersionAtLeast(int version)
public static boolean isVersionAtMost(int version)
public static boolean isVersionGreaterThan(int version)
public static boolean isVersionLessThan(int version)
public static int version()