public class JavaVMVersionToolkit
extends java.lang.Object
Constructor and Description |
---|
JavaVMVersionToolkit() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decodeJavaVersion(java.lang.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(java.lang.String vmName)
Returns whether this is a HotSpot JVM or not.
|
static boolean |
isJRockitJVMName(java.lang.String vmName)
Returns whether this is a JRockit JVM or not.
|
private static boolean |
isNumber(java.lang.String string) |
static java.lang.String |
parseJavaVersion(java.lang.String version)
Parses version string to find java version, such as 1.6.
|
public static java.lang.String decodeJavaVersion(java.lang.String vmVersion)
vmVersion
- the full VM version.public static java.lang.String parseJavaVersion(java.lang.String version)
version
- A string that may contain a java versionprivate static boolean isNumber(java.lang.String string)
public static boolean isJRockitJVMName(java.lang.String vmName)
vmName
- the JVM name to check.true
of it is a JRockit, false
if it isn't or if was not
possible to tell.public static boolean isHotspotJVMName(java.lang.String vmName)
vmName
- the JVM name to check.true
if it is a HotSpot, false
if it isn't or if was not
possible to tell.