/** * Return the version of Java this class is running under. * @return the version of Java as a String, e.g. "1.1" . * @see org.apache.tools.ant.util.JavaEnvUtils#getJavaVersion * @deprecated since 1.5.x. * Use org.apache.tools.ant.util.JavaEnvUtils instead. */ @Deprecated public static String getJavaVersion() { return JavaEnvUtils.getJavaVersion(); }
/** * Set the <code>ant.java.version</code> property and tests for * unsupported JVM versions. If the version is supported, * verbose log messages are generated to record the Java version * and operating system name. * * @exception BuildException if this Java version is not supported. * * @see org.apache.tools.ant.util.JavaEnvUtils#getJavaVersion */ public void setJavaVersionProperty() throws BuildException { final String javaVersion = JavaEnvUtils.getJavaVersion(); setPropertyInternal(MagicNames.ANT_JAVA_VERSION, javaVersion); // sanity check if (!JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_1_8)) { throw new BuildException("Ant cannot work on Java prior to 1.8"); } log("Detected Java version: " + javaVersion + " in: " + System.getProperty("java.home"), MSG_VERBOSE); log("Detected OS: " + System.getProperty("os.name"), MSG_VERBOSE); }
/** * Constructor uses the VM we are running on now. */ public CommandlineJava() { setVm(JavaEnvUtils.getJreExecutable("java")); setVmversion(JavaEnvUtils.getJavaVersion()); }
createClasspathArgument(cmd, sourcepath); final String javaVersion = JavaEnvUtils.getJavaVersion(); String memoryParameterPrefix = javaVersion.equals(JavaEnvUtils.JAVA_1_1) ? "-J-" : "-J-X";//$NON-NLS-1$//$NON-NLS-2$ if (this.memoryInitialSize != null) {
createClasspathArgument(cmd, classpath); final String javaVersion = JavaEnvUtils.getJavaVersion(); String memoryParameterPrefix = javaVersion.equals(JavaEnvUtils.JAVA_1_1) ? "-J-" : "-J-X";//$NON-NLS-1$//$NON-NLS-2$ if (this.memoryInitialSize != null) {
createClasspathArgument(cmd, sourcepath); final String javaVersion = JavaEnvUtils.getJavaVersion(); String memoryParameterPrefix = javaVersion.equals(JavaEnvUtils.JAVA_1_1) ? "-J-" : "-J-X";//$NON-NLS-1$//$NON-NLS-2$ if (this.memoryInitialSize != null) {
createClasspathArgument(cmd, sourcepath); final String javaVersion = JavaEnvUtils.getJavaVersion(); String memoryParameterPrefix = javaVersion.equals(JavaEnvUtils.JAVA_1_1) ? "-J-" : "-J-X";//$NON-NLS-1$//$NON-NLS-2$ if (this.memoryInitialSize != null) {