Top Description Fields Constructors Methods
org.objenesis.strategy

public final Class PlatformDescription

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, org.objenesis.ObjenesisException

List of constants describing the currently used platform.
Author
Henri Tremblay

Field Summary

Modifier and TypeField and Description
public static final int
ANDROID_VERSION

Android version.

public static final String
DALVIK

JVM_NAME prefix for Dalvik/Android

public static final String
GAE_VERSION

Google App Engine version or null is we are not on GAE

public static final String
GNU

JVM_NAME prefix for GCJ

public static final String
HOTSPOT

JVM_NAME prefix for Java HotSpot

public static final boolean
IS_ANDROID_OPENJDK

Flag telling if this version of Android is based on the OpenJDK

public static final String
JVM_NAME

JVM name

public static final String
OPENJDK

JVM_NAME prefix for the OpenJDK

public static final String
PERC

JVM_NAME prefix for Aonix PERC

public static final String
SPECIFICATION_VERSION

Java specification version

public static final String
SUN

JVM_NAME prefix for Java HotSpot

public static final String
VENDOR

VM vendor name

public static final String
VENDOR_VERSION

VM vendor version

public static final String
VM_INFO

JVM version

public static final String
VM_VERSION

JVM version

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

Description of the current platform
describePlatform
()

Describes the platform.

private static int
private static int
private static String

Returns:

Java runtime version on GAE. Null if not on GEA
getGaeRuntimeVersion
()

Deprecated No need to differentiate GAE anymore since they have stopped using a security manager
Give the GAE Java version used.
private static boolean
private static int
getOldAndroidVersion(Class<?> versionClass)

public static boolean

Returns:

if the current JVM is Java 11 or above
isAfterJava11
()

Tells if the current JVM is running Java 11 or above

public static boolean

Returns:

if the current JVM is Java 9 or above
isAfterJigsaw
()

Tells if the current JVM is running Java 9 or above

public static boolean

Returns:

if it's an Android version based on the OpenJDK. Will return false if this JVM isn't an Android JVM at all
isAndroidOpenJDK
()

Check if this JVM is an Android JVM based on OpenJDK.

public static boolean

Returns:

are we running on Google App Engine
isGoogleAppEngine
()

Deprecated No need to differentiate GAE anymore since they have stopped using a security manager
Tells if the platform running the JVM is Google App Engine.
public static boolean

Returns:

if it's the requested JVM
isThisJVM
(String
jvm name we are looking for
name
)

Check if the current JVM is of the type passed in parameter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANDROID_VERSIONback to summary
public static final int ANDROID_VERSION

Android version. Will be 0 for none android platform

DALVIKback to summary
public static final String DALVIK

JVM_NAME prefix for Dalvik/Android

GAE_VERSIONback to summary
public static final String GAE_VERSION

Deprecated

No need to differentiate GAE anymore since they have stopped using a security manager

Google App Engine version or null is we are not on GAE

Annotations
@Deprecated
GNUback to summary
public static final String GNU

JVM_NAME prefix for GCJ

HOTSPOTback to summary
public static final String HOTSPOT

JVM_NAME prefix for Java HotSpot

IS_ANDROID_OPENJDKback to summary
public static final boolean IS_ANDROID_OPENJDK

Flag telling if this version of Android is based on the OpenJDK

JVM_NAMEback to summary
public static final String JVM_NAME

JVM name

OPENJDKback to summary
public static final String OPENJDK

JVM_NAME prefix for the OpenJDK

PERCback to summary
public static final String PERC

JVM_NAME prefix for Aonix PERC

SPECIFICATION_VERSIONback to summary
public static final String SPECIFICATION_VERSION

Java specification version

SUNback to summary
public static final String SUN

Deprecated

Use HOTSPOT instead

JVM_NAME prefix for Java HotSpot

Annotations
@Deprecated
VENDORback to summary
public static final String VENDOR

VM vendor name

VENDOR_VERSIONback to summary
public static final String VENDOR_VERSION

VM vendor version

VM_INFOback to summary
public static final String VM_INFO

JVM version

VM_VERSIONback to summary
public static final String VM_VERSION

JVM version

Constructor Detail

PlatformDescriptionback to summary
private PlatformDescription()

Method Detail

describePlatformback to summary
public static String describePlatform()

Describes the platform. Outputs Java version and vendor.

Returns:String

Description of the current platform

getAndroidVersionback to summary
private static int getAndroidVersion()
getAndroidVersion0back to summary
private static int getAndroidVersion0()
getGaeRuntimeVersionback to summary
private static String getGaeRuntimeVersion()

Deprecated

No need to differentiate GAE anymore since they have stopped using a security manager

Give the GAE Java version used. To know if it was before or after the restricting security manager.

Returns:String

Java runtime version on GAE. Null if not on GEA

Annotations
@Deprecated
getIsAndroidOpenJDKback to summary
private static boolean getIsAndroidOpenJDK()
getOldAndroidVersionback to summary
private static int getOldAndroidVersion(Class<?> versionClass)
isAfterJava11back to summary
public static boolean isAfterJava11()

Tells if the current JVM is running Java 11 or above

Returns:boolean

if the current JVM is Java 11 or above

isAfterJigsawback to summary
public static boolean isAfterJigsaw()

Tells if the current JVM is running Java 9 or above

Returns:boolean

if the current JVM is Java 9 or above

isAndroidOpenJDKback to summary
public static boolean isAndroidOpenJDK()

Check if this JVM is an Android JVM based on OpenJDK.

Returns:boolean

if it's an Android version based on the OpenJDK. Will return false if this JVM isn't an Android JVM at all

isGoogleAppEngineback to summary
public static boolean isGoogleAppEngine()

Deprecated

No need to differentiate GAE anymore since they have stopped using a security manager

Tells if the platform running the JVM is Google App Engine.

Returns:boolean

are we running on Google App Engine

Annotations
@Deprecated
isThisJVMback to summary
public static boolean isThisJVM(String name)

Check if the current JVM is of the type passed in parameter. Normally, this will be a constant from this class. We basically do System.getProperty("java.vm.name").startWith(name).

Parameters
name:String

jvm name we are looking for

Returns:boolean

if it's the requested JVM