Starting with Java 10 we've stopped adding JAVA_
and VERSION_ attributes for new major version numbers
of the JVM.
| Modifier and Type | Field and Description |
|---|---|
| private static boolean | classpathDetected
Whether this is a GNU Classpath based VM |
| private static final FileUtils | FILE_UTILS
FileUtils instance for path normalization |
| private static boolean | gijDetected
Whether this is the GNU VM (gcj/gij) |
| private static boolean | harmonyDetected
Whether this is Apache Harmony |
| private static final boolean | IS_AIX
Are we on AIX |
| private static final boolean | IS_DOS
Are we on a DOS-based system |
| private static final boolean | IS_NETWARE
Are we on Novell NetWare |
| public static final String | JAVA_10
Version constant for Java 10 |
| public static final String | JAVA_11
Version constant for Java 11 |
| public static final String | JAVA_12
Version constant for Java 12 |
| public static final String | JAVA_1_0
Version constant for Java 1.0 |
| public static final String | JAVA_1_1
Version constant for Java 1.1 |
| public static final String | JAVA_1_2
Version constant for Java 1.2 |
| public static final String | JAVA_1_3
Version constant for Java 1.3 |
| public static final String | JAVA_1_4
Version constant for Java 1.4 |
| public static final String | JAVA_1_5
Version constant for Java 1.5 |
| public static final String | JAVA_1_6
Version constant for Java 1.6 |
| public static final String | JAVA_1_7
Version constant for Java 1.7 |
| public static final String | JAVA_1_8
Version constant for Java 1.8 |
| public static final String | JAVA_1_9
Version constant for Java 1.9 |
| public static final String | JAVA_9
Version constant for Java 9 |
| private static final String | JAVA_HOME
shortcut for System.getProperty("java.home") |
| private static String | javaVersion
Version of currently running VM. |
| private static int | javaVersionNumber
floating version of the JVM |
| private static Vector | jrePackages
array of packages in the runtime |
| private static boolean | kaffeDetected
Whether this is the Kaffe VM |
| private static final DeweyDecimal | parsedJavaVersion
Version of currently running VM. |
| public static final int | VERSION_10
Number Version constant for Java 10 |
| public static final int | VERSION_11
Number Version constant for Java 11 |
| public static final int | VERSION_12
Number Version constant for Java 12 |
| public static final int | VERSION_1_0
Number Version constant for Java 1.0 |
| public static final int | VERSION_1_1
Number Version constant for Java 1.1 |
| public static final int | VERSION_1_2
Number Version constant for Java 1.2 |
| public static final int | VERSION_1_3
Number Version constant for Java 1.3 |
| public static final int | VERSION_1_4
Number Version constant for Java 1.4 |
| public static final int | VERSION_1_5
Number Version constant for Java 1.5 |
| public static final int | VERSION_1_6
Number Version constant for Java 1.6 |
| public static final int | VERSION_1_7
Number Version constant for Java 1.7 |
| public static final int | VERSION_1_8
Number Version constant for Java 1.8 |
| public static final int | VERSION_1_9
Number Version constant for Java 1.9 |
| public static final int | VERSION_9
Number Version constant for Java 9 |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| private static void | |
| public static File | Returns: the file containing the command.the command. cmds)Writes the command into a temporary DCL script and returns the corresponding File object. |
| private static File | |
| public static String | |
| public static String | Returns: the version of Java as a String, e.g. "1.6" or "9"Returns the version of Java this class is running under. |
| public static int | Returns: the version of Java as a number 10x the major/minor, e.g Java1.5 has a value of 15 and Java9 the value 90 - major will be 1 for all versions of Java prior to Java 9, minor will be 0 for all versions of Java starting with Java 9.
Deprecated
use #getParsedJavaVersion instead
Returns the version of Java this class is running under.
|
| public static String | Returns: the path to the command.the java executable to find. command)Finds an executable that is part of a JDK installation based on the java.home system property. |
| public static String | Returns: the path to the command.the java executable to find. command)Finds an executable that is part of a JRE installation based on the java.home system property. |
| public static Vector | Returns: list of packages.get a vector of strings of packages built into that platforms runtime jar(s) |
| public static Vector | Returns: a list of test classes depending on the java version.Testing helper method; kept here for unification of changes. |
| public static DeweyDecimal | Returns: the version of Java as major.minor, e.g Java1.5 has a value of 1.5 and Java9 the value 9 - major will be 1 for all versions of Java prior to Java 9, minor will be 0 for all versions of Java starting with Java 9.Returns the version of Java this class is running under. |
| public static boolean | Returns: true if the current VM is Apache Harmony.Checks whether the current VM is Apache Harmony. |
| public static boolean | Returns: true if the version of Java is the same or higher than the given version.the version to check against the current version. version)Compares the current Java version to the passed in String - assumes the argument is one of the constants defined in this class. |
| public static boolean | Returns: true if the version of Java is GNU ClasspathChecks whether the current Java VM is GNU Classpath |
| public static boolean | Returns: true if the current Java VM is gcj/gij.Checks whether the current Java VM is the GNU interpreter gij or we are running in a gcj precompiled binary. |
| public static boolean | Returns: true if the version of Java is the same as the given version.the version to check against the current version. version)Compares the current Java version to the passed in String - assumes the argument is one of the constants defined in this class. |
| public static boolean |
| classpathDetected | back to summary |
|---|---|
| private static boolean classpathDetected Whether this is a GNU Classpath based VM | |
| FILE_UTILS | back to summary |
|---|---|
| private static final FileUtils FILE_UTILS FileUtils instance for path normalization | |
| gijDetected | back to summary |
|---|---|
| private static boolean gijDetected Whether this is the GNU VM (gcj/gij) | |
| harmonyDetected | back to summary |
|---|---|
| private static boolean harmonyDetected Whether this is Apache Harmony | |
| IS_AIX | back to summary |
|---|---|
| private static final boolean IS_AIX Are we on AIX | |
| IS_DOS | back to summary |
|---|---|
| private static final boolean IS_DOS Are we on a DOS-based system | |
| IS_NETWARE | back to summary |
|---|---|
| private static final boolean IS_NETWARE Are we on Novell NetWare | |
| JAVA_10 | back to summary |
|---|---|
| public static final String JAVA_10 Version constant for Java 10
| |
| JAVA_11 | back to summary |
|---|---|
| public static final String JAVA_11 Version constant for Java 11
| |
| JAVA_12 | back to summary |
|---|---|
| public static final String JAVA_12 Version constant for Java 12
| |
| JAVA_1_0 | back to summary |
|---|---|
| public static final String JAVA_1_0 Version constant for Java 1.0 | |
| JAVA_1_1 | back to summary |
|---|---|
| public static final String JAVA_1_1 Version constant for Java 1.1 | |
| JAVA_1_2 | back to summary |
|---|---|
| public static final String JAVA_1_2 Version constant for Java 1.2 | |
| JAVA_1_3 | back to summary |
|---|---|
| public static final String JAVA_1_3 Version constant for Java 1.3 | |
| JAVA_1_4 | back to summary |
|---|---|
| public static final String JAVA_1_4 Version constant for Java 1.4 | |
| JAVA_1_5 | back to summary |
|---|---|
| public static final String JAVA_1_5 Version constant for Java 1.5 | |
| JAVA_1_6 | back to summary |
|---|---|
| public static final String JAVA_1_6 Version constant for Java 1.6 | |
| JAVA_1_7 | back to summary |
|---|---|
| public static final String JAVA_1_7 Version constant for Java 1.7 | |
| JAVA_1_8 | back to summary |
|---|---|
| public static final String JAVA_1_8 Version constant for Java 1.8 | |
| JAVA_1_9 | back to summary |
|---|---|
| public static final String JAVA_1_9
Deprecated use #JAVA_9 instead Version constant for Java 1.9 | |
| JAVA_9 | back to summary |
|---|---|
| public static final String JAVA_9 Version constant for Java 9
| |
| JAVA_HOME | back to summary |
|---|---|
| private static final String JAVA_HOME shortcut for System.getProperty("java.home") | |
| javaVersion | back to summary |
|---|---|
| private static String javaVersion Version of currently running VM. | |
| javaVersionNumber | back to summary |
|---|---|
| private static int javaVersionNumber floating version of the JVM | |
| jrePackages | back to summary |
|---|---|
| private static Vector<String> jrePackages array of packages in the runtime | |
| kaffeDetected | back to summary |
|---|---|
| private static boolean kaffeDetected Whether this is the Kaffe VM | |
| parsedJavaVersion | back to summary |
|---|---|
| private static final DeweyDecimal parsedJavaVersion Version of currently running VM. | |
| VERSION_10 | back to summary |
|---|---|
| public static final int VERSION_10 Number Version constant for Java 10
| |
| VERSION_11 | back to summary |
|---|---|
| public static final int VERSION_11 Number Version constant for Java 11
| |
| VERSION_12 | back to summary |
|---|---|
| public static final int VERSION_12 Number Version constant for Java 12
| |
| VERSION_1_0 | back to summary |
|---|---|
| public static final int VERSION_1_0 Number Version constant for Java 1.0 | |
| VERSION_1_1 | back to summary |
|---|---|
| public static final int VERSION_1_1 Number Version constant for Java 1.1 | |
| VERSION_1_2 | back to summary |
|---|---|
| public static final int VERSION_1_2 Number Version constant for Java 1.2 | |
| VERSION_1_3 | back to summary |
|---|---|
| public static final int VERSION_1_3 Number Version constant for Java 1.3 | |
| VERSION_1_4 | back to summary |
|---|---|
| public static final int VERSION_1_4 Number Version constant for Java 1.4 | |
| VERSION_1_5 | back to summary |
|---|---|
| public static final int VERSION_1_5 Number Version constant for Java 1.5 | |
| VERSION_1_6 | back to summary |
|---|---|
| public static final int VERSION_1_6 Number Version constant for Java 1.6 | |
| VERSION_1_7 | back to summary |
|---|---|
| public static final int VERSION_1_7 Number Version constant for Java 1.7 | |
| VERSION_1_8 | back to summary |
|---|---|
| public static final int VERSION_1_8 Number Version constant for Java 1.8 | |
| VERSION_1_9 | back to summary |
|---|---|
| public static final int VERSION_1_9
Deprecated use #VERSION_9 instead Number Version constant for Java 1.9 | |
| VERSION_9 | back to summary |
|---|---|
| public static final int VERSION_9 Number Version constant for Java 9
| |
| JavaEnvUtils | back to summary |
|---|---|
| private JavaEnvUtils() | |
| addExtension | back to summary |
|---|---|
| private static String addExtension(String command) Adds a system specific extension to the name of an executable.
| |
| buildJrePackages | back to summary |
|---|---|
| private static void buildJrePackages() demand creation of the package list. When you add a new package, add a new test below. | |
| createVmsJavaOptionFile | back to summary |
|---|---|
| public static File createVmsJavaOptionFile(String[] cmds) throws IOException Writes the command into a temporary DCL script and returns the corresponding File object. It is the job of the caller to delete the file on exit.
| |
| findInDir | back to summary |
|---|---|
| private static File findInDir(String dirName, String commandName) Look for an executable in a given directory.
| |
| getJavaHome | back to summary |
|---|---|
| public static String getJavaHome() Return the value of ${java.home}
| |
| getJavaVersion | back to summary |
|---|---|
| public static String getJavaVersion() Returns the version of Java this class is running under. Up until Java 8 Java version numbers were 1.VERSION - e.g. 1.8.x for Java 8, starting with Java 9 it became 9.x.
| |
| getJavaVersionNumber | back to summary |
|---|---|
| public static int getJavaVersionNumber()
Deprecated use #getParsedJavaVersion instead Returns the version of Java this class is running under. This number can be used for comparisons.
| |
| getJdkExecutable | back to summary |
|---|---|
| public static String getJdkExecutable(String command) Finds an executable that is part of a JDK installation based on the java.home system property. You typically find them in | |
| getJreExecutable | back to summary |
|---|---|
| public static String getJreExecutable(String command) Finds an executable that is part of a JRE installation based on the java.home system property.
You typically find them in | |
| getJrePackages | back to summary |
|---|---|
| public static Vector get a vector of strings of packages built into that platforms runtime jar(s) | |
| getJrePackageTestCases | back to summary |
|---|---|
| public static Vector Testing helper method; kept here for unification of changes. | |
| getParsedJavaVersion | back to summary |
|---|---|
| public static DeweyDecimal getParsedJavaVersion() Returns the version of Java this class is running under. This number can be used for comparisons.
| |
| isApacheHarmony | back to summary |
|---|---|
| public static boolean isApacheHarmony() Checks whether the current VM is Apache Harmony.
| |
| isAtLeastJavaVersion | back to summary |
|---|---|
| public static boolean isAtLeastJavaVersion(String version) Compares the current Java version to the passed in String -
assumes the argument is one of the constants defined in this
class.
Note that Ant now requires JDK 1.8+ so
| |
| isClasspathBased | back to summary |
|---|---|
| public static boolean isClasspathBased() Checks whether the current Java VM is GNU Classpath
| |
| isGij | back to summary |
|---|---|
| public static boolean isGij() Checks whether the current Java VM is the GNU interpreter gij or we are running in a gcj precompiled binary.
| |
| isJavaVersion | back to summary |
|---|---|
| public static boolean isJavaVersion(String version) Compares the current Java version to the passed in String -
assumes the argument is one of the constants defined in this
class.
Note that Ant now requires JDK 1.8+ so
| |
| isKaffe | back to summary |
|---|---|
| public static boolean isKaffe() Checks whether the current Java VM is Kaffe.
| |