Package org.openjdk.jmc.common.version
Class JavaVMVersionToolkit
java.lang.Object
org.openjdk.jmc.common.version.JavaVMVersionToolkit
A toolkit to handle JVM versions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
decodeJavaVersion
(String vmVersion) Since Sun decided not to have java.specification.version as a performance counter, we need to try to decode the specification version from the VM version.static boolean
isHotspotJVMName
(String vmName) Returns whether this is a HotSpot JVM or not.static boolean
isJRockitJVMName
(String vmName) Returns whether this is a JRockit JVM or not.static boolean
isOpenJDKJVMName
(String vmName) Returns whether this is a OpenJDK JVM or not.static boolean
isSubstrateVMName
(String vmName) Returns whether this is a Substrate VM or not.static String
parseJavaVersion
(String version) Parses version string to find java version, such as 1.6.
-
Constructor Details
-
JavaVMVersionToolkit
public JavaVMVersionToolkit()
-
-
Method Details
-
decodeJavaVersion
Since Sun decided not to have java.specification.version as a performance counter, we need to try to decode the specification version from the VM version.- Parameters:
vmVersion
- the full VM version.- Returns:
- the java specification version, or something close to it.
-
parseJavaVersion
Parses version string to find java version, such as 1.6.- Parameters:
version
- A string that may contain a java version- Returns:
- Short java version, or null
-
isJRockitJVMName
Returns whether this is a JRockit JVM or not.- Parameters:
vmName
- the JVM name to check.- Returns:
true
if it is a JRockit,false
if it isn't or if it was not possible to tell.
-
isHotspotJVMName
Returns whether this is a HotSpot JVM or not.- Parameters:
vmName
- the JVM name to check.- Returns:
true
if it is a HotSpot,false
if it isn't or if it was not possible to tell.
-
isSubstrateVMName
Returns whether this is a Substrate VM or not.- Parameters:
vmName
- the VM name to check.- Returns:
true
if it is a Substrate VM,false
if it isn't or if if was not possible to tell.
-
isOpenJDKJVMName
Returns whether this is a OpenJDK JVM or not.- Parameters:
vmName
- the JVM name to check.- Returns:
true
if it is a OpenJDK JVM,false
if it isn't or if it was not possible to tell.
-