public class JavaVersion
extends java.lang.Object
JavaVersion
class is a helper class to handle various
Java version strings and query about the version of the Java VM the
application is running.
The version information provided is based on the Java Runtime of the currently running Virtual Machine.
This is a utility class, which cannot be instantiated.
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getSpecificationVersion()
Returns the specification version of the current Java Runtime library.
|
static java.lang.String |
getVersion()
Returns the implementation version of the current Java Runtime library.
|
static boolean |
is13()
Returns
true if the specification version of the current
Java Runtime library is 1.3 . |
static boolean |
is14()
Returns
true if the specification version of the current
Java Runtime library is 1.4 . |
static boolean |
is15()
Returns
true if the specification version of the current
Java Runtime library is 1.5 . |
static boolean |
isCompatibleWith(java.lang.String specVersion)
Returns
true if the specification version of the current
Java Runtime library is compatible with the given specification version,
that is if the specification version of the current Java Runtime library
is the same or newer than the given version. |
static boolean |
isCompatibleWith13()
Returns
true if the specification version of the current
Java Runtime library is compatible with 1.3 , that is if the
specification version of the current Java Runtime library is the same or
newer than 1.3 . |
static boolean |
isCompatibleWith14()
Returns
true if the specification version of the current
Java Runtime library is compatible with 1.4 , that is if the
specification version of the current Java Runtime library is the same or
newer than 1.4 . |
static boolean |
isCompatibleWith15()
Returns
true if the specification version of the current
Java Runtime library is compatible with 1.5 , that is if the
specification version of the current Java Runtime library is the same or
newer than 1.5 . |
static boolean |
isSpecificationVersion(java.lang.String specVersion)
Returns
true if the specification version of the current
Java Runtime library the given version string. |
public static java.lang.String getVersion()
public static java.lang.String getSpecificationVersion()
public static boolean is13()
true
if the specification version of the current
Java Runtime library is 1.3
. This is a convenience method
completely equivalent to
isSpecificationVersion("1.3")
.public static boolean is14()
true
if the specification version of the current
Java Runtime library is 1.4
. This is a convenience method
completely equivalent to
isSpecificationVersion("1.4")
.public static boolean is15()
true
if the specification version of the current
Java Runtime library is 1.5
. This is a convenience method
completely equivalent to
isSpecificationVersion("1.5")
.public static boolean isSpecificationVersion(java.lang.String specVersion)
true
if the specification version of the current
Java Runtime library the given version string.specVersion
- The specification version to compare to the
specification of the current Hava Runtime library.public static boolean isCompatibleWith13()
true
if the specification version of the current
Java Runtime library is compatible with 1.3
, that is if the
specification version of the current Java Runtime library is the same or
newer than 1.3
. This is a convenience method completely
equivalent to
isCompatibleWith("1.3")
.public static boolean isCompatibleWith14()
true
if the specification version of the current
Java Runtime library is compatible with 1.4
, that is if the
specification version of the current Java Runtime library is the same or
newer than 1.4
. This is a convenience method completely
equivalent to
isCompatibleWith("1.4")
.public static boolean isCompatibleWith15()
true
if the specification version of the current
Java Runtime library is compatible with 1.5
, that is if the
specification version of the current Java Runtime library is the same or
newer than 1.5
. This is a convenience method completely
equivalent to
isCompatibleWith("1.5")
.public static boolean isCompatibleWith(java.lang.String specVersion)
true
if the specification version of the current
Java Runtime library is compatible with the given specification version,
that is if the specification version of the current Java Runtime library
is the same or newer than the given version.specVersion
- The specification version to compare to the
specification of the current Hava Runtime library.Copyright © 2010 - 2020 Adobe. All Rights Reserved