public class JavaVersion extends Object
Modifier and Type | Field and Description |
---|---|
static JavaVersion |
JAVA_1_5
StaticConstant for Java 1.5 (Tiger).
|
Constructor and Description |
---|
JavaVersion(int major,
int minor)
Constructor.
|
JavaVersion(String versionString)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getMajor()
Get the major version number.
|
int |
getMinor()
Get the minor version number.
|
String |
getRest()
Get the rest of the version string after the major and minor numbers.
|
static JavaVersion |
getRuntimeVersion()
Get the version of Java that we are currently running under.
|
boolean |
isSameOrNewerThan(JavaVersion other)
Return whether the Java version represented by this object is at least as
recent as the one given.
|
String |
toString() |
public static final JavaVersion JAVA_1_5
public JavaVersion(String versionString) throws JavaVersionException
versionString
- a version string, as returned from the
java.version
system property: e.g., "1.4.2_04"JavaVersionException
public JavaVersion(int major, int minor)
major
- major versionminor
- minor versionpublic int getMajor()
public int getMinor()
public String getRest()
public static JavaVersion getRuntimeVersion()
public boolean isSameOrNewerThan(JavaVersion other)
other
- another JavaVersionCopyright © 2003–2015. All rights reserved.