public class

JvmVersionUtil

extends Object
java.lang.Object
   ↳ com.atlassian.jira.util.system.check.JvmVersionUtil

Class Overview

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

Summary

Constants
String JAVA_VERSION_5
String JAVA_VERSION_6
Public Constructors
JvmVersionUtil()
Public Methods
int getBuildNumber(String javaVersion)
int getMajorVersion(String javaVersion)
int getMinorVersion(String javaVersion)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String JAVA_VERSION_5

Constant Value: "1.5.0"

public static final String JAVA_VERSION_6

Constant Value: "1.6.0"

Public Constructors

public JvmVersionUtil ()

Public Methods

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

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

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