Class PlatformDescription
java.lang.Object
org.objenesis.strategy.PlatformDescription
List of constants describing the currently used platform.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAndroid version.static final StringJVM_NAME prefix for Dalvik/Androidstatic final StringGoogle App Engine version or null is we are not on GAEstatic final StringJVM_NAME prefix for GCJstatic final StringJVM_NAME prefix for Java HotSpotstatic final booleanFlag telling if this version of Android is based on the OpenJDKstatic final StringJVM namestatic final StringJVM_NAME prefix for the OpenJDKstatic final StringJVM_NAME prefix for Aonix PERCstatic final StringJava specification versionstatic final StringDeprecated.static final StringVM vendor namestatic final StringVM vendor versionstatic final StringJVM versionstatic final StringJVM version -
Method Summary
Modifier and TypeMethodDescriptionstatic StringDescribes the platform.static booleanTells if the current JVM is running Java 11 or abovestatic booleanTells if the current JVM is running Java 9 or abovestatic booleanCheck if this JVM is an Android JVM based on OpenJDK.static booleanstatic booleanCheck if the current JVM is of the type passed in parameter.
-
Field Details
-
GNU
-
HOTSPOT
-
SUN
-
OPENJDK
-
PERC
-
DALVIK
-
SPECIFICATION_VERSION
Java specification version -
VM_VERSION
JVM version -
VM_INFO
JVM version -
VENDOR_VERSION
VM vendor version -
VENDOR
VM vendor name -
JVM_NAME
JVM name -
ANDROID_VERSION
public static final int ANDROID_VERSIONAndroid version. Will be 0 for none android platform -
IS_ANDROID_OPENJDK
public static final boolean IS_ANDROID_OPENJDKFlag telling if this version of Android is based on the OpenJDK -
GAE_VERSION
Google App Engine version or null is we are not on GAE
-
-
Method Details
-
describePlatform
Describes the platform. Outputs Java version and vendor.- Returns:
- Description of the current platform
-
isThisJVM
Check if the current JVM is of the type passed in parameter. Normally, this will be a constant from this class. We basically doSystem.getProperty("java.vm.name").startWith(name).- Parameters:
name- jvm name we are looking for- Returns:
- if it's the requested JVM
-
isAndroidOpenJDK
public static boolean isAndroidOpenJDK()Check if this JVM is an Android JVM based on OpenJDK.- Returns:
- if it's an Android version based on the OpenJDK. Will return false if this JVM isn't an Android JVM at all
-
isAfterJigsaw
public static boolean isAfterJigsaw()Tells if the current JVM is running Java 9 or above- Returns:
- if the current JVM is Java 9 or above
-
isAfterJava11
public static boolean isAfterJava11()Tells if the current JVM is running Java 11 or above- Returns:
- if the current JVM is Java 11 or above
-
isGoogleAppEngine
public static boolean isGoogleAppEngine()
-
HOTSPOTinstead