com.atlassian.jira.util.system.check
Class JvmVersionUtil

java.lang.Object
  extended by com.atlassian.jira.util.system.check.JvmVersionUtil

public class JvmVersionUtil
extends Object

A utility class for retreiving the various parts of a Java version

Since:
v4.0

Field Summary
static String JAVA_VERSION_5
           
static String JAVA_VERSION_6
           
 
Constructor Summary
JvmVersionUtil()
           
 
Method Summary
 int getBuildNumber(String javaVersion)
           
 int getMajorVersion(String javaVersion)
           
 int getMinorVersion(String javaVersion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_VERSION_6

public static final String JAVA_VERSION_6
See Also:
Constant Field Values

JAVA_VERSION_5

public static final String JAVA_VERSION_5
See Also:
Constant Field Values
Constructor Detail

JvmVersionUtil

public JvmVersionUtil()
Method Detail

getMajorVersion

public int getMajorVersion(String javaVersion)
Parameters:
javaVersion - the full Java version string
Returns:
the Major version of the Java string, e.g. "1.6.0_10_b3" will return 6 or -1 if the version can not be read

getMinorVersion

public int getMinorVersion(String javaVersion)
Parameters:
javaVersion - the full Java version string
Returns:
the Minor version of the Java string, e.g. "1.6.0_10_b3" will return 10 or -1 if the version can not be read

getBuildNumber

public int getBuildNumber(String javaVersion)
Parameters:
javaVersion - the full Java version string
Returns:
the build number of the Java string, e.g. "1.6.0_10_b3" will return 3 or -1 if the version can not be read


Copyright © 2002-2011 Atlassian. All Rights Reserved.