Bug 495617 - Mars: Honor External Tools Configurations "Classpath | Ant
Home" and "JRE | Separate JRE"

Change-Id: I1360efa272a361a843742c4bb90c1476a1935384

diff --git a/ant/org.eclipse.ant.launching/.gitignore b/ant/org.eclipse.ant.launching/.gitignore
index 3d07972..d984724 100644
--- a/ant/org.eclipse.ant.launching/.gitignore
+++ b/ant/org.eclipse.ant.launching/.gitignore
@@ -1,4 +1,4 @@
-lib
+lib/loggers.jar
 temp.folder
 loggers_bin
 common_bin
diff --git a/ant/org.eclipse.ant.launching/buildfiles/buildCommonDebug.xml b/ant/org.eclipse.ant.launching/buildfiles/buildCommonDebug.xml
index 7d91240..d2c109a 100644
--- a/ant/org.eclipse.ant.launching/buildfiles/buildCommonDebug.xml
+++ b/ant/org.eclipse.ant.launching/buildfiles/buildCommonDebug.xml
@@ -24,9 +24,15 @@
 		<delete dir="${destdir}"/>
 		<mkdir dir="${destdir}"/>
 		<!-- copy necessary class files resources -->
-		<copy todir="${destdir}">
+		<!--copy todir="${destdir}">
 			<fileset dir="${basedir}/common_bin"/>
-		</copy>
+		</copy -->
+		<javac target="1.6" source="1.6" destdir="${destdir}" failonerror="false" verbose="false" debug="on"  includeAntRuntime="yes"  classpath="${basedir}/bin">
+			<src path="${basedir}/common"/>
+			<compilerarg value="-Xlint"/>
+		</javac>
+		<copy file="${basedir}/common_bin/META-INF/eclipse.inf" tofile="${destdir}/META-INF/eclipse.inf"/>
+		
 		<mkdir dir="${build.result.folder}/lib"/>
 		<jar destfile="${build.result.folder}/lib/antdebug.jar" basedir="${destdir}"/>
 		<delete dir="${temp.folder}"/>
diff --git a/ant/org.eclipse.ant.launching/buildfiles/buildRemote.xml b/ant/org.eclipse.ant.launching/buildfiles/buildRemote.xml
index 2122e58..a654092 100644
--- a/ant/org.eclipse.ant.launching/buildfiles/buildRemote.xml
+++ b/ant/org.eclipse.ant.launching/buildfiles/buildRemote.xml
@@ -24,9 +24,16 @@
 		<delete dir="${destdir}"/>
 		<mkdir dir="${destdir}"/>
 		<!-- copy necessary class files resources -->
-		<copy todir="${destdir}">
+		<!--copy todir="${destdir}">
 			<fileset dir="${basedir}/remote_bin"/>
-		</copy>
+		</copy-->
+		<javac target="1.6" source="1.6" destdir="${destdir}" failonerror="false" verbose="false" debug="on"  includeAntRuntime="yes" includejavaruntime="true"
+			 classpath="${basedir}/bin">
+			<src path="${basedir}/remote"/>
+			<compilerarg value="-Xlint"/>
+		</javac>
+		<copy file="${basedir}/remote_bin/META-INF/eclipse.inf" tofile="${destdir}/META-INF/eclipse.inf"/>
+		<copy file="${basedir}/remote_bin/org/eclipse/ant/internal/launching/remote/RemoteAntMessages.properties" tofile="${destdir}/org/eclipse/ant/internal/launching/remote/RemoteAntMessages.properties"/>
 		<mkdir dir="${build.result.folder}/lib"/>
 		<jar destfile="${build.result.folder}/lib/remote.jar" basedir="${destdir}"/>
 		<delete dir="${temp.folder}"/>
diff --git a/ant/org.eclipse.ant.launching/common/org/eclipse/ant/internal/launching/debug/AntDebugState.java b/ant/org.eclipse.ant.launching/common/org/eclipse/ant/internal/launching/debug/AntDebugState.java
index 231ffd0..d923de3 100644
--- a/ant/org.eclipse.ant.launching/common/org/eclipse/ant/internal/launching/debug/AntDebugState.java
+++ b/ant/org.eclipse.ant.launching/common/org/eclipse/ant/internal/launching/debug/AntDebugState.java
@@ -24,8 +24,6 @@
 import org.apache.tools.ant.Target;
 import org.apache.tools.ant.Task;
 import org.apache.tools.ant.taskdefs.MacroInstance;
-
-import org.eclipse.ant.internal.core.IAntCoreConstants;
 import org.eclipse.ant.internal.launching.debug.model.DebugMessageIds;
 
 public class AntDebugState {
@@ -34,8 +32,10 @@
 	private static final String fgAntCallTaskName = "antcall"; //$NON-NLS-1$
 
 	private IDebugBuildLogger fLogger;
-	private Stack<Task> fTasks = new Stack<>();
-	private Map<Task, Object> fTaskToProxies = new HashMap<>();
+	@SuppressWarnings("unused")
+	private Stack<Task> fTasks = new Stack<Task>();
+	@SuppressWarnings("unused")
+	private Map<Task, Object> fTaskToProxies = new HashMap<Task, Object>();
 	private Task fCurrentTask;
 	private Task fStepOverTask;
 	private Task fStepIntoTask;
@@ -47,8 +47,10 @@
 
 	private Map<Project, Vector<?>> fProjectToTargetNames = null;
 	private Map<Project, Map<Target, Vector<Target>>> fProjectToMapOfTargetToBuildSequence = null;
-	private Stack<Target> fTargetsToExecute = new Stack<>();
-	private Stack<Target> fTargetsExecuting = new Stack<>();
+	@SuppressWarnings("unused")
+	private Stack<Target> fTargetsToExecute = new Stack<Target>();
+	@SuppressWarnings("unused")
+	private Stack<Target> fTargetsExecuting = new Stack<Target>();
 
 	private boolean fConsiderTargetBreakpoints = false;
 	private boolean fShouldSuspend;
@@ -60,9 +62,10 @@
 		fLogger = logger;
 	}
 
+	@SuppressWarnings("unused")
 	public void buildStarted() {
-		fProjectToTargetNames = new HashMap<>();
-		fProjectToMapOfTargetToBuildSequence = new HashMap<>();
+		fProjectToTargetNames = new HashMap<Project, Vector<?>>();
+		fProjectToMapOfTargetToBuildSequence = new HashMap<Project, Map<Target, Vector<Target>>>();
 	}
 
 	/**
@@ -300,7 +303,8 @@
 			Object ref = eventProject.getReference(IAntCoreConstants.TARGET_VECTOR_NAME);
 			if (ref != null) {
 				fProjectToTargetNames.put(eventProject, (Vector<?>) ref);
-				HashMap<Target, Vector<Target>> targetToBuildSequence = new HashMap<>();
+				@SuppressWarnings("unused")
+				HashMap<Target, Vector<Target>> targetToBuildSequence = new HashMap<Target, Vector<Target>>();
 				setTargetToExecute(initializeBuildSequenceInformation(event, targetToBuildSequence));
 				fProjectToMapOfTargetToBuildSequence.put(eventProject, targetToBuildSequence);
 			}
@@ -519,7 +523,8 @@
 	}
 
 	private String escapeLineSeparator(String stringToEscape) {
-		if (!(stringToEscape.indexOf('\r') != -1 || stringToEscape.indexOf('\n') != -1 || stringToEscape.indexOf("\\r") != -1 || stringToEscape.indexOf("\\n") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
+		if (!(stringToEscape.indexOf('\r') != -1 || stringToEscape.indexOf('\n') != -1 || stringToEscape.indexOf("\\r") != -1 //$NON-NLS-1$
+				|| stringToEscape.indexOf("\\n") != -1)) { //$NON-NLS-1$
 			return stringToEscape;
 		}
 		StringBuffer escapedValue = new StringBuffer(stringToEscape);
diff --git a/ant/org.eclipse.ant.launching/common/org/eclipse/ant/internal/launching/debug/IAntCoreConstants.java b/ant/org.eclipse.ant.launching/common/org/eclipse/ant/internal/launching/debug/IAntCoreConstants.java
new file mode 100644
index 0000000..3862684
--- /dev/null
+++ b/ant/org.eclipse.ant.launching/common/org/eclipse/ant/internal/launching/debug/IAntCoreConstants.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2016 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ant.internal.launching.debug;
+
+/**
+ * Common constants.
+ */
+public interface IAntCoreConstants {
+
+	// default values
+	public static final String DEFAULT_BUILD_FILENAME = "build.xml"; //$NON-NLS-1$
+
+	// preferences
+	public static final String PREFERENCE_TASKS = "tasks"; //$NON-NLS-1$
+	public static final String PREFERENCE_TYPES = "types"; //$NON-NLS-1$
+
+	public static final String PREFIX_TASK = "task."; //$NON-NLS-1$
+	public static final String PREFIX_TYPE = "type."; //$NON-NLS-1$
+
+	/**
+	 * Preferences
+	 * 
+	 * @since 3.0
+	 */
+	public static final String PREFERENCE_ANT_HOME_ENTRIES = "ant_home_entries"; //$NON-NLS-1$
+	public static final String PREFERENCE_ADDITIONAL_ENTRIES = "additional_entries"; //$NON-NLS-1$
+
+	public static final String PREFERENCE_CLASSPATH_CHANGED = "classpath_changed"; //$NON-NLS-1$
+
+	/**
+	 * Preferences
+	 * 
+	 * @since 2.1
+	 */
+	public static final String PREFERENCE_ANT_HOME = "ant_home"; //$NON-NLS-1$
+	public static final String PREFERENCE_PROPERTIES = "properties"; //$NON-NLS-1$
+	public static final String PREFERENCE_PROPERTY_FILES = "propertyfiles"; //$NON-NLS-1$
+	public static final String PREFIX_PROPERTY = "property."; //$NON-NLS-1$
+
+	/**
+	 * Constant representing the word 'id' <br>
+	 * <br>
+	 * Value is: <code>id</code>
+	 * 
+	 * @since 3.2.500
+	 */
+	public static final String ID = "id"; //$NON-NLS-1$
+
+	/**
+	 * Constant representing the word 'augment' <br>
+	 * <br>
+	 * Value is: <code>augment</code>
+	 * 
+	 * @since 3.2.500
+	 */
+	public static final String AUGMENT = "augment"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the word 'default' <br>
+	 * <br>
+	 * Value is: <code>default</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String DEFAULT = "default"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the word 'dir' <br>
+	 * <br>
+	 * Value is: <code>dir</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String DIR = "dir"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the empty {@link String}
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String EMPTY_STRING = ""; //$NON-NLS-1$
+
+	/**
+	 * Constant for the word 'file' <br>
+	 * <br>
+	 * Value is: <code>file</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String FILE = "file"; //$NON-NLS-1$
+
+	/**
+	 * Constant representing a file URL protocol <br>
+	 * <br>
+	 * Value is: <code>file:</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String FILE_PROTOCOL = "file:"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the word 'description' <br>
+	 * <br>
+	 * Value is: <code>description</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String DESCRIPTION = "description"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the encoding <code>UTF-8</code> <br>
+	 * <br>
+	 * Value is: <code>UTF-8</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.3.0
+	 */
+	public static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
+
+	/**
+	 * The name of the XML build file extension. <br>
+	 * <br>
+	 * Value is: <code>xml</code>
+	 * 
+	 * @since 3.8
+	 */
+	public static final String XML_EXTENSION = "xml"; //$NON-NLS-1$
+
+	/**
+	 * The name of the target vector property used by the Eclipse executor <br>
+	 * <br>
+	 * Value is: <code>eclipse.ant.targetVector</code>
+	 * 
+	 * @since 3.3.0
+	 */
+	public static final String TARGET_VECTOR_NAME = "eclipse.ant.targetVector"; //$NON-NLS-1$
+}
diff --git a/ant/org.eclipse.ant.launching/lib/antdebug.jar b/ant/org.eclipse.ant.launching/lib/antdebug.jar
new file mode 100644
index 0000000..06295bd
--- /dev/null
+++ b/ant/org.eclipse.ant.launching/lib/antdebug.jar
Binary files differ
diff --git a/ant/org.eclipse.ant.launching/lib/remote.jar b/ant/org.eclipse.ant.launching/lib/remote.jar
new file mode 100644
index 0000000..7421106
--- /dev/null
+++ b/ant/org.eclipse.ant.launching/lib/remote.jar
Binary files differ
diff --git a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseDefaultExecutor.java b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseDefaultExecutor.java
index ec3cd89..3a80c03 100644
--- a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseDefaultExecutor.java
+++ b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseDefaultExecutor.java
@@ -17,7 +17,6 @@
 import org.apache.tools.ant.Executor;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.helper.DefaultExecutor;
-import org.eclipse.ant.internal.core.IAntCoreConstants;
 
 public class EclipseDefaultExecutor extends DefaultExecutor {
 
@@ -28,9 +27,10 @@
 	 * 
 	 * @see org.apache.tools.ant.Executor#executeTargets(org.apache.tools.ant.Project, java.lang.String[])
 	 */
+	@SuppressWarnings("unused")
 	@Override
 	public void executeTargets(Project project, String[] targetNames) throws BuildException {
-		Vector<String> v = new Vector<>();
+		Vector<String> v = new Vector<String>();
 		v.addAll(Arrays.asList(targetNames));
 		project.addReference(IAntCoreConstants.TARGET_VECTOR_NAME, v);
 		super.executeTargets(project, targetNames);
diff --git a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseSingleCheckExecutor.java b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseSingleCheckExecutor.java
index 2bed9c1..b14a371 100644
--- a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseSingleCheckExecutor.java
+++ b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/EclipseSingleCheckExecutor.java
@@ -17,7 +17,6 @@
 import org.apache.tools.ant.Executor;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.helper.SingleCheckExecutor;
-import org.eclipse.ant.internal.core.IAntCoreConstants;
 
 public class EclipseSingleCheckExecutor extends SingleCheckExecutor {
 
@@ -26,9 +25,10 @@
 	 * 
 	 * @see org.apache.tools.ant.Executor#executeTargets(org.apache.tools.ant.Project, java.lang.String[])
 	 */
+	@SuppressWarnings("unused")
 	@Override
 	public void executeTargets(Project project, String[] targetNames) throws BuildException {
-		Vector<String> v = new Vector<>();
+		Vector<String> v = new Vector<String>();
 		v.addAll(Arrays.asList(targetNames));
 		project.addReference(IAntCoreConstants.TARGET_VECTOR_NAME, v);
 		super.executeTargets(project, targetNames);
diff --git a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/IAntCoreConstants.java b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/IAntCoreConstants.java
new file mode 100644
index 0000000..51477db
--- /dev/null
+++ b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/IAntCoreConstants.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2016 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ant.internal.launching.remote;
+
+/**
+ * Common constants.
+ */
+public interface IAntCoreConstants {
+
+	// default values
+	public static final String DEFAULT_BUILD_FILENAME = "build.xml"; //$NON-NLS-1$
+
+	// preferences
+	public static final String PREFERENCE_TASKS = "tasks"; //$NON-NLS-1$
+	public static final String PREFERENCE_TYPES = "types"; //$NON-NLS-1$
+
+	public static final String PREFIX_TASK = "task."; //$NON-NLS-1$
+	public static final String PREFIX_TYPE = "type."; //$NON-NLS-1$
+
+	/**
+	 * Preferences
+	 * 
+	 * @since 3.0
+	 */
+	public static final String PREFERENCE_ANT_HOME_ENTRIES = "ant_home_entries"; //$NON-NLS-1$
+	public static final String PREFERENCE_ADDITIONAL_ENTRIES = "additional_entries"; //$NON-NLS-1$
+
+	public static final String PREFERENCE_CLASSPATH_CHANGED = "classpath_changed"; //$NON-NLS-1$
+
+	/**
+	 * Preferences
+	 * 
+	 * @since 2.1
+	 */
+	public static final String PREFERENCE_ANT_HOME = "ant_home"; //$NON-NLS-1$
+	public static final String PREFERENCE_PROPERTIES = "properties"; //$NON-NLS-1$
+	public static final String PREFERENCE_PROPERTY_FILES = "propertyfiles"; //$NON-NLS-1$
+	public static final String PREFIX_PROPERTY = "property."; //$NON-NLS-1$
+
+	/**
+	 * Constant representing the word 'id' <br>
+	 * <br>
+	 * Value is: <code>id</code>
+	 * 
+	 * @since 3.2.500
+	 */
+	public static final String ID = "id"; //$NON-NLS-1$
+
+	/**
+	 * Constant representing the word 'augment' <br>
+	 * <br>
+	 * Value is: <code>augment</code>
+	 * 
+	 * @since 3.2.500
+	 */
+	public static final String AUGMENT = "augment"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the word 'default' <br>
+	 * <br>
+	 * Value is: <code>default</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String DEFAULT = "default"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the word 'dir' <br>
+	 * <br>
+	 * Value is: <code>dir</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String DIR = "dir"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the empty {@link String}
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String EMPTY_STRING = ""; //$NON-NLS-1$
+
+	/**
+	 * Constant for the word 'file' <br>
+	 * <br>
+	 * Value is: <code>file</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String FILE = "file"; //$NON-NLS-1$
+
+	/**
+	 * Constant representing a file URL protocol <br>
+	 * <br>
+	 * Value is: <code>file:</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String FILE_PROTOCOL = "file:"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the word 'description' <br>
+	 * <br>
+	 * Value is: <code>description</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.2.200
+	 */
+	public static final String DESCRIPTION = "description"; //$NON-NLS-1$
+
+	/**
+	 * Constant for the encoding <code>UTF-8</code> <br>
+	 * <br>
+	 * Value is: <code>UTF-8</code>
+	 * 
+	 * @since org.eclipse.ant.core 3.3.0
+	 */
+	public static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
+
+	/**
+	 * The name of the XML build file extension. <br>
+	 * <br>
+	 * Value is: <code>xml</code>
+	 * 
+	 * @since 3.8
+	 */
+	public static final String XML_EXTENSION = "xml"; //$NON-NLS-1$
+
+	/**
+	 * The name of the target vector property used by the Eclipse executor <br>
+	 * <br>
+	 * Value is: <code>eclipse.ant.targetVector</code>
+	 * 
+	 * @since 3.3.0
+	 */
+	public static final String TARGET_VECTOR_NAME = "eclipse.ant.targetVector"; //$NON-NLS-1$
+}
diff --git a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java
index 72a59cf..e3e6588 100644
--- a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java
+++ b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java
@@ -48,7 +48,6 @@
 import org.apache.tools.ant.Task;
 import org.apache.tools.ant.TaskAdapter;
 import org.apache.tools.ant.util.FileUtils;
-import org.eclipse.ant.internal.core.IAntCoreConstants;
 import org.eclipse.ant.internal.launching.remote.logger.RemoteAntBuildLogger;
 
 /**
@@ -112,7 +111,8 @@
 
 	private boolean scriptExecuted = false;
 
-	private List<String> propertyFiles = new ArrayList<>();
+	@SuppressWarnings("unused")
+	private List<String> propertyFiles = new ArrayList<String>();
 
 	/**
 	 * The Ant InputHandler class. There may be only one input handler.
@@ -149,6 +149,7 @@
 	/*
 	 * Helper method to ensure an array is converted into an ArrayList.
 	 */
+	@SuppressWarnings("unused")
 	static ArrayList<String> getArrayList(String[] args) {
 		if (args == null) {
 			return null;
@@ -156,7 +157,7 @@
 		// We could be using Arrays.asList() here, but it does not specify
 		// what kind of list it will return. We need a list that
 		// implements the method List.remove(Object) and ArrayList does.
-		ArrayList<String> result = new ArrayList<>(args.length);
+		ArrayList<String> result = new ArrayList<String>(args.length);
 		for (int i = 0; i < args.length; i++) {
 			result.add(args[i]);
 		}
@@ -244,6 +245,7 @@
 	 * @param project
 	 *            the project to list targets from
 	 */
+	@SuppressWarnings("unused")
 	private void printTargets(Project project) {
 		// notify the logger that project help message are coming
 		// since there is no buildstarted or targetstarted to
@@ -257,9 +259,9 @@
 		Target currentTarget;
 		// split the targets in top-level and sub-targets depending
 		// on the presence of a description
-		List<String> topNames = new ArrayList<>();
-		List<String> topDescriptions = new ArrayList<>();
-		List<String> subNames = new ArrayList<>();
+		List<String> topNames = new ArrayList<String>();
+		List<String> topDescriptions = new ArrayList<String>();
+		List<String> subNames = new ArrayList<String>();
 
 		while (ptargets.hasMoreElements()) {
 			currentTarget = ptargets.nextElement();
@@ -282,13 +284,13 @@
 
 		String defaultTargetName = project.getDefaultTarget();
 		if (defaultTargetName != null && !IAntCoreConstants.EMPTY_STRING.equals(defaultTargetName)) { // shouldn't need to check but...
-			List<String> defaultName = new ArrayList<>(1);
+			List<String> defaultName = new ArrayList<String>(1);
 			List<String> defaultDesc = null;
 			defaultName.add(defaultTargetName);
 
 			int indexOfDefDesc = topNames.indexOf(defaultTargetName);
 			if (indexOfDefDesc >= 0) {
-				defaultDesc = new ArrayList<>(1);
+				defaultDesc = new ArrayList<String>(1);
 				defaultDesc.add(topDescriptions.get(indexOfDefDesc));
 			}
 			printTargets(project, defaultName, defaultDesc, RemoteAntMessages.getString("InternalAntRunner.Default_target__3"), maxLength); //$NON-NLS-1$
@@ -338,6 +340,7 @@
 	/*
 	 * Note that the list passed to this method must support List#remove(Object)
 	 */
+	@SuppressWarnings("unused")
 	private void run(List<String> argList) {
 		setCurrentProject(new Project());
 		if (isVersionCompatible("1.6.3")) { //$NON-NLS-1$
@@ -444,7 +447,7 @@
 			System.setSecurityManager(new AntSecurityManager(originalSM, Thread.currentThread()));
 
 			if (targets == null) {
-				targets = new Vector<>(1);
+				targets = new Vector<String>(1);
 			}
 			if (targets.isEmpty() && getCurrentProject().getDefaultTarget() != null) {
 				targets.add(getCurrentProject().getDefaultTarget());
@@ -664,7 +667,8 @@
 	 */
 	private String getAntVersionNumber() throws BuildException {
 		if (antVersionNumber == null) {
-			try (InputStream in = Main.class.getResourceAsStream("/org/apache/tools/ant/version.txt")) {//$NON-NLS-1$
+			try {
+				InputStream in = Main.class.getResourceAsStream("/org/apache/tools/ant/version.txt");//$NON-NLS-1$
 				Properties props = new Properties();
 				props.load(in);
 				String versionNumber = props.getProperty("VERSION"); //$NON-NLS-1$
@@ -690,6 +694,7 @@
 		return version.compareTo(comparison) >= 0;
 	}
 
+	@SuppressWarnings("unused")
 	private boolean preprocessCommandLine(List<String> commands) {
 
 		String arg = getArgument(commands, "-listener"); //$NON-NLS-1$
@@ -698,7 +703,7 @@
 				throw new BuildException(RemoteAntMessages.getString("InternalAntRunner.You_must_specify_a_classname_when_using_the_-listener_argument_1")); //$NON-NLS-1$
 			}
 			if (buildListeners == null) {
-				buildListeners = new ArrayList<>(1);
+				buildListeners = new ArrayList<String>(1);
 			}
 			buildListeners.add(arg);
 			arg = getArgument(commands, "-listener"); //$NON-NLS-1$
@@ -852,11 +857,12 @@
 		return true;
 	}
 
+	@SuppressWarnings("unused")
 	private void processTasksAndTypes(List<String> commands) {
 		String arg = getArgument(commands, "-eclipseTask"); //$NON-NLS-1$
 		while (arg != null) {
 			if (eclipseSpecifiedTasks == null) {
-				eclipseSpecifiedTasks = new HashMap<>();
+				eclipseSpecifiedTasks = new HashMap<String, String>();
 			}
 			int index = arg.indexOf(',');
 			if (index != -1) {
@@ -870,7 +876,7 @@
 		arg = getArgument(commands, "-eclipseType"); //$NON-NLS-1$
 		while (arg != null) {
 			if (eclipseSpecifiedTypes == null) {
-				eclipseSpecifiedTypes = new HashMap<>();
+				eclipseSpecifiedTypes = new HashMap<String, String>();
 			}
 			int index = arg.indexOf(',');
 			if (index != -1) {
@@ -917,9 +923,10 @@
 	/*
 	 * Checks for targets specified at the command line.
 	 */
+	@SuppressWarnings("unused")
 	private void processTargets(List<String> commands) {
 		if (targets == null) {
-			targets = new Vector<>(commands.size());
+			targets = new Vector<String>(commands.size());
 		}
 		for (String string : commands) {
 			targets.add(string);
@@ -992,6 +999,7 @@
 		return exceptionToBeThrown;
 	}
 
+	@SuppressWarnings("unused")
 	private void processMinusDProperties(List<String> commands) {
 		String[] args = commands.toArray(new String[commands.size()]);
 		for (int i = 0; i < args.length; i++) {
@@ -1013,7 +1021,7 @@
 					continue;
 				}
 				if (userProperties == null) {
-					userProperties = new HashMap<>();
+					userProperties = new HashMap<String, String>();
 				}
 				userProperties.put(name, value);
 				commands.remove(args[i]);
@@ -1179,11 +1187,13 @@
 	/**
 	 * Load all properties from the files specified by -propertyfile.
 	 */
+	@SuppressWarnings("unused")
 	private void loadPropertyFiles() {
 		for (String filename : propertyFiles) {
 			File file = getFileRelativeToBaseDir(filename);
 			Properties props = new Properties();
-			try (FileInputStream fis = new FileInputStream(file)) {
+			try {
+				FileInputStream fis = new FileInputStream(file);
 				props.load(fis);
 			}
 			catch (IOException e) {
@@ -1191,7 +1201,7 @@
 						filename, e.getMessage() });
 			}
 			if (userProperties == null) {
-				userProperties = new HashMap<>();
+				userProperties = new HashMap<String, String>();
 			}
 			Enumeration<?> propertyNames = props.propertyNames();
 			while (propertyNames.hasMoreElements()) {
diff --git a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBuildLogger.java b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBuildLogger.java
index 013560b..9e6a475 100644
--- a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBuildLogger.java
+++ b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBuildLogger.java
@@ -28,9 +28,9 @@
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Target;
 import org.apache.tools.ant.util.StringUtils;
-import org.eclipse.ant.internal.core.IAntCoreConstants;
 import org.eclipse.ant.internal.launching.debug.AntDebugState;
 import org.eclipse.ant.internal.launching.remote.AntSecurityException;
+import org.eclipse.ant.internal.launching.remote.IAntCoreConstants;
 import org.eclipse.ant.internal.launching.remote.InternalAntRunner;
 import org.eclipse.ant.internal.launching.remote.RemoteAntMessages;
 
@@ -254,6 +254,7 @@
 	 * 
 	 * @see org.apache.tools.ant.BuildListener#messageLogged(org.apache.tools.ant.BuildEvent)
 	 */
+	@SuppressWarnings("unused")
 	@Override
 	public void messageLogged(BuildEvent event) {
 		if (event.getPriority() > msgOutputLevel && event.getPriority() != InternalAntRunner.MSG_PROJECT_HELP) {
@@ -270,7 +271,7 @@
 				return;
 			}
 			if (fEventQueue == null) {
-				fEventQueue = new ArrayList<>(10);
+				fEventQueue = new ArrayList<BuildEvent>(10);
 			}
 			fEventQueue.add(event);
 			return;
diff --git a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntDebugBuildLogger.java b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntDebugBuildLogger.java
index 688a926..984954e 100644
--- a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntDebugBuildLogger.java
+++ b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntDebugBuildLogger.java
@@ -360,9 +360,10 @@
 		sendRequestResponse(propertiesRepresentation.toString());
 	}
 
+	@SuppressWarnings("unused")
 	protected void addBreakpoint(String breakpointRepresentation) {
 		if (fBreakpoints == null) {
-			fBreakpoints = new ArrayList<>();
+			fBreakpoints = new ArrayList<RemoteAntBreakpoint>();
 		}
 		RemoteAntBreakpoint newBreakpoint = new RemoteAntBreakpoint(breakpointRepresentation);
 		if (!fBreakpoints.contains(newBreakpoint)) {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java
index 13739ba..6501c24 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java
@@ -129,8 +129,11 @@
 				}
 				// int ver = (int) (CompilerOptions.versionToJdkLevel(vmver) >>> 16);
 				if (JavaCore.compareJavaVersions(vmver, JavaCore.VERSION_1_7) < 0) {
-					IStatus status = new Status(IStatus.ERROR, AntLaunching.PLUGIN_ID, 1, AntLaunchConfigurationMessages.AntLaunchDelegate_Launching__0__2, null);
-					throw new CoreException(status);
+					boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
+					if (useDefault) { // Java 1.7 and above is required if Default Ant Home is used
+						IStatus status = new Status(IStatus.ERROR, AntLaunching.PLUGIN_ID, 1, AntLaunchConfigurationMessages.AntLaunchDelegate_Launching__0__2, null);
+						throw new CoreException(status);
+					}
 				}
 			}
 		}
diff --git a/ant/org.eclipse.ant.ui/.gitignore b/ant/org.eclipse.ant.ui/.gitignore
index 1f570d2..340326b 100644
--- a/ant/org.eclipse.ant.ui/.gitignore
+++ b/ant/org.eclipse.ant.ui/.gitignore
@@ -1,4 +1,4 @@
-lib
+lib/antrunner.jar
 temp.folder
 antui.jar
 ant_runner_support_bin
diff --git a/ant/org.eclipse.ant.ui/Remote Ant Support/org/eclipse/ant/internal/ui/antsupport/inputhandler/SWTInputHandler.java b/ant/org.eclipse.ant.ui/Remote Ant Support/org/eclipse/ant/internal/ui/antsupport/inputhandler/SWTInputHandler.java
index feacb86..a38c107 100644
--- a/ant/org.eclipse.ant.ui/Remote Ant Support/org/eclipse/ant/internal/ui/antsupport/inputhandler/SWTInputHandler.java
+++ b/ant/org.eclipse.ant.ui/Remote Ant Support/org/eclipse/ant/internal/ui/antsupport/inputhandler/SWTInputHandler.java
@@ -146,7 +146,7 @@
 
 		String value = null;
 		try {
-			fRequest.getClass().getMethod("getDefaultValue", new Class[0]); //$NON-NLS-1$
+			fRequest.getClass().getMethod("getDefaultValue", new Class<?>[0]); //$NON-NLS-1$
 			value = fRequest.getDefaultValue();
 		}
 		catch (SecurityException e) {
diff --git a/ant/org.eclipse.ant.ui/buildfiles/buildRemoteExtraJAR.xml b/ant/org.eclipse.ant.ui/buildfiles/buildRemoteExtraJAR.xml
index 0444ef6..2ee7027 100644
--- a/ant/org.eclipse.ant.ui/buildfiles/buildRemoteExtraJAR.xml
+++ b/ant/org.eclipse.ant.ui/buildfiles/buildRemoteExtraJAR.xml
@@ -33,9 +33,16 @@
 		<delete dir="${destdir}"/>
 		<mkdir dir="${destdir}"/>
 		<!-- copy necessary resources -->
-		<copy todir="${destdir}">
+		<!--copy todir="${destdir}">
 			<fileset dir="${basedir}/remote_support_bin/"/>
-		</copy>
+		</copy -->
+		<javac target="1.6" source="1.6" destdir="${destdir}" failonerror="false" verbose="false" debug="on"  includeAntRuntime="yes">
+			<src path="${basedir}/Remote Ant Support"/>
+			<compilerarg value="-Xlint"/>
+		</javac>
+		<copy file="${basedir}/remote_support_bin/META-INF/eclipse.inf" tofile="${destdir}/META-INF/eclipse.inf"/>
+		<copy file="${basedir}/remote_support_bin/org/eclipse/ant/internal/ui/antsupport/inputhandler/RemoteAntMessages.properties" tofile="${destdir}/org/eclipse/ant/internal/ui/antsupport/inputhandler/RemoteAntMessages.properties"/>
+		
 		<mkdir dir="${build.result.folder}/lib"/>
 		<jar destfile="${build.result.folder}/lib/remoteAnt.jar" basedir="${destdir}"/>
 		<delete dir="${temp.folder}"/>
diff --git a/ant/org.eclipse.ant.ui/lib/remoteAnt.jar b/ant/org.eclipse.ant.ui/lib/remoteAnt.jar
new file mode 100644
index 0000000..e70274d
--- /dev/null
+++ b/ant/org.eclipse.ant.ui/lib/remoteAnt.jar
Binary files differ