Bug 113909 - Extension point for installing a JRE
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntClasspathProvider.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntClasspathProvider.java
index da2f8a9..6b58333 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntClasspathProvider.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntClasspathProvider.java
@@ -15,12 +15,9 @@
import java.util.List;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.launching.StandardClasspathProvider;
@@ -33,18 +30,17 @@
boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
if (useDefault) {
List rtes = new ArrayList(10);
- IVMInstall vm= null;
+ IRuntimeClasspathEntry jreEntry = null;
try {
- vm= JavaRuntime.computeVMInstall(configuration);
- } catch (CoreException ce) {
- //likely in a non-Java project
- vm= JavaRuntime.getDefaultVMInstall();
+ jreEntry = JavaRuntime.computeJREEntry(configuration);
+ } catch (CoreException e) {
+ // not a java project
}
- IPath containerPath = new Path(JavaRuntime.JRE_CONTAINER);
- containerPath = containerPath.append(new Path(vm.getVMInstallType().getId()));
- containerPath = containerPath.append(new Path(vm.getName()));
-
- rtes.add(JavaRuntime.newRuntimeContainerClasspathEntry(containerPath, IRuntimeClasspathEntry.STANDARD_CLASSES));
+ if (jreEntry == null) {
+ jreEntry = JavaRuntime.newRuntimeContainerClasspathEntry(
+ JavaRuntime.newDefaultJREContainerPath(), IRuntimeClasspathEntry.STANDARD_CLASSES);
+ }
+ rtes.add(jreEntry);
rtes.add(new AntHomeClasspathEntry());
rtes.add(new ContributedClasspathEntriesEntry());
return (IRuntimeClasspathEntry[]) rtes.toArray(new IRuntimeClasspathEntry[rtes.size()]);