| |
|
| java.lang.Object org.apache.tools.ant.util.JavaEnvUtils
JavaEnvUtils | final public class JavaEnvUtils (Code) | | A set of helper methods related to locating executables or checking
conditons of a given Java installation.
since: Ant 1.5 |
Method Summary | |
public static File | createVmsJavaOptionFile(String[] cmd) 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.
Parameters: cmd - the command. | public static String | getJavaHome() | public static String | getJavaVersion() Returns the version of Java this class is running under.
the version of Java as a String, e.g. | public static int | getJavaVersionNumber() Returns the version of Java this class is running under. | 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 JAVA_HOME/bin if
JAVA_HOME points to your JDK installation.
Parameters: command - the java executable to find. | public static String | getJreExecutable(String command) Finds an executable that is part of a JRE installation based on
the java.home system property.
java , keytool ,
policytool , orbd , rmid ,
rmiregistry , servertool and
tnameserv are JRE executables on Sun based
JRE's.
You typically find them in JAVA_HOME/jre/bin if
JAVA_HOME points to your JDK installation. | public static Vector | getJrePackageTestCases() Testing helper method; kept here for unification of changes. | public static Vector | getJrePackages() | 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.2+ so
JavaEnvUtils.JAVA_1_0 and
JavaEnvUtils.JAVA_1_1 need no longer be tested for.
Parameters: version - the version to check against the current version. | 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.2+ so
JavaEnvUtils.JAVA_1_0 and
JavaEnvUtils.JAVA_1_1 need no longer be tested for.
Parameters: version - the version to check against the current version. | public static boolean | isKaffe() Checks whether the current Java VM is Kaffe. |
JAVA_1_0 | final public static String JAVA_1_0(Code) | | Version constant for Java 1.0
|
JAVA_1_1 | final public static String JAVA_1_1(Code) | | Version constant for Java 1.1
|
JAVA_1_2 | final public static String JAVA_1_2(Code) | | Version constant for Java 1.2
|
JAVA_1_3 | final public static String JAVA_1_3(Code) | | Version constant for Java 1.3
|
JAVA_1_4 | final public static String JAVA_1_4(Code) | | Version constant for Java 1.4
|
JAVA_1_5 | final public static String JAVA_1_5(Code) | | Version constant for Java 1.5
|
JAVA_1_6 | final public static String JAVA_1_6(Code) | | Version constant for Java 1.6
|
createVmsJavaOptionFile | public static File createVmsJavaOptionFile(String[] cmd) throws IOException(Code) | | 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.
Parameters: cmd - the command. the file containing the command. throws: IOException - if there is an error writing to the file. |
getJavaHome | public static String getJavaHome()(Code) | | Return the value of ${java.home}
the java home value. |
getJavaVersion | public static String getJavaVersion()(Code) | | Returns the version of Java this class is running under.
the version of Java as a String, e.g. "1.1" |
getJavaVersionNumber | public static int getJavaVersionNumber()(Code) | | Returns the version of Java this class is running under.
This number can be used for comparisions; it will always be
the version of Java as a number 10x the major/minor,e.g Java1.5 has a value of 15 |
getJdkExecutable | public static String getJdkExecutable(String command)(Code) | | Finds an executable that is part of a JDK installation based on
the java.home system property.
You typically find them in JAVA_HOME/bin if
JAVA_HOME points to your JDK installation.
Parameters: command - the java executable to find. the path to the command. since: Ant 1.5 |
getJreExecutable | public static String getJreExecutable(String command)(Code) | | Finds an executable that is part of a JRE installation based on
the java.home system property.
java , keytool ,
policytool , orbd , rmid ,
rmiregistry , servertool and
tnameserv are JRE executables on Sun based
JRE's.
You typically find them in JAVA_HOME/jre/bin if
JAVA_HOME points to your JDK installation. JDK
< 1.2 has them in the same directory as the JDK
executables.
Parameters: command - the java executable to find. the path to the command. since: Ant 1.5 |
getJrePackageTestCases | public static Vector getJrePackageTestCases()(Code) | | Testing helper method; kept here for unification of changes.
a list of test classes depending on the java version. |
getJrePackages | public static Vector getJrePackages()(Code) | | get a vector of strings of packages built into
that platforms runtime jar(s)
list of packages. |
isAtLeastJavaVersion | public static boolean isAtLeastJavaVersion(String version)(Code) | | 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.2+ so
JavaEnvUtils.JAVA_1_0 and
JavaEnvUtils.JAVA_1_1 need no longer be tested for.
Parameters: version - the version to check against the current version. true if the version of Java is the same or higher than thegiven version. since: Ant 1.7 |
isJavaVersion | public static boolean isJavaVersion(String version)(Code) | | 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.2+ so
JavaEnvUtils.JAVA_1_0 and
JavaEnvUtils.JAVA_1_1 need no longer be tested for.
Parameters: version - the version to check against the current version. true if the version of Java is the same as the given version. since: Ant 1.5 |
isKaffe | public static boolean isKaffe()(Code) | | Checks whether the current Java VM is Kaffe.
true if the current Java VM is Kaffe. since: Ant 1.6.3 |
|
|
|