Save This Page
Home » apache-ant-1.7.1-src » org.apache.tools » ant » util » [javadoc | source]
org.apache.tools.ant.util
public final class: JavaEnvUtils [javadoc | source]
java.lang.Object
   org.apache.tools.ant.util.JavaEnvUtils
A set of helper methods related to locating executables or checking conditons of a given Java installation.
Field Summary
public static final  String JAVA_1_0    Version constant for Java 1.0 
public static final  int VERSION_1_0    Number Version constant for Java 1.0 
public static final  String JAVA_1_1    Version constant for Java 1.1 
public static final  int VERSION_1_1    Number Version constant for Java 1.1 
public static final  String JAVA_1_2    Version constant for Java 1.2 
public static final  int VERSION_1_2    Number Version constant for Java 1.2 
public static final  String JAVA_1_3    Version constant for Java 1.3 
public static final  int VERSION_1_3    Number Version constant for Java 1.3 
public static final  String JAVA_1_4    Version constant for Java 1.4 
public static final  int VERSION_1_4    Number Version constant for Java 1.4 
public static final  String JAVA_1_5    Version constant for Java 1.5 
public static final  int VERSION_1_5    Number Version constant for Java 1.5 
public static final  String JAVA_1_6    Version constant for Java 1.6 
public static final  int VERSION_1_6    Number Version constant for Java 1.6 
Method from org.apache.tools.ant.util.JavaEnvUtils Summary:
createVmsJavaOptionFile,   getJavaHome,   getJavaVersion,   getJavaVersionNumber,   getJdkExecutable,   getJreExecutable,   getJrePackageTestCases,   getJrePackages,   isAtLeastJavaVersion,   isJavaVersion,   isKaffe
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.util.JavaEnvUtils Detail:
 public static File createVmsJavaOptionFile(String[] cmd) 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.
 public static String getJavaHome() 
    Return the value of ${java.home}
 public static String getJavaVersion() 
    Returns the version of Java this class is running under.
 public static int getJavaVersionNumber() 
    Returns the version of Java this class is running under. This number can be used for comparisions; it will always be
 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.

 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. JDK < 1.2 has them in the same directory as the JDK executables.

 public static Vector getJrePackageTestCases() 
    Testing helper method; kept here for unification of changes.
 public static Vector getJrePackages() 
    get a vector of strings of packages built into that platforms runtime jar(s)
 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 #JAVA_1_0 and #JAVA_1_1 need no longer be tested for.
 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 #JAVA_1_0 and #JAVA_1_1 need no longer be tested for.
 public static boolean isKaffe() 
    Checks whether the current Java VM is Kaffe.