bug 13524
diff --git a/org.eclipse.jdt.debug.ui/plugin.xml b/org.eclipse.jdt.debug.ui/plugin.xml
index 367e4a6..644607e 100644
--- a/org.eclipse.jdt.debug.ui/plugin.xml
+++ b/org.eclipse.jdt.debug.ui/plugin.xml
@@ -1031,10 +1031,5 @@
vmInstallTypeID="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"
class="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMCommandTab">
</vmInstallTypePage>
- <vmInstallTypePage
- id="org.eclipse.jdt.debug.ui.J9VMCommandTab"
- vmInstallTypeID="org.eclipse.jdt.internal.launching.j9.J9Type"
- class="org.eclipse.jdt.internal.debug.ui.launcher.J9VMCommandTab">
- </vmInstallTypePage>
</extension>
</plugin>
\ No newline at end of file
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
index 8534961..19a6324 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
@@ -8,6 +8,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.io.File;
import org.eclipse.core.runtime.CoreException;
@@ -281,21 +282,33 @@
// always set the newly created area with defaults
ILaunchConfigurationWorkingCopy wc = getLaunchConfigurationWorkingCopy();
- if (wc == null) {
- try {
+ if (getDynamicTab() == null) {
+ // remove any VM specfic args from the config
+ if (wc == null) {
if (getLaunchConfiguration().isWorkingCopy()) {
- // get a fresh copy to work on
- wc = ((ILaunchConfigurationWorkingCopy)getLaunchConfiguration()).getOriginal().getWorkingCopy();
- } else {
- wc = getLaunchConfiguration().getWorkingCopy();
+ wc = (ILaunchConfigurationWorkingCopy)getLaunchConfiguration();
}
- } catch (CoreException e) {
- JDIDebugUIPlugin.errorDialog("Unable to initialize defaults for selected JRE", e);
- return;
}
+ if (wc != null) {
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE_SPECIFIC_ATTRS_MAP, (Map)null);
+ }
+ } else {
+ if (wc == null) {
+ try {
+ if (getLaunchConfiguration().isWorkingCopy()) {
+ // get a fresh copy to work on
+ wc = ((ILaunchConfigurationWorkingCopy)getLaunchConfiguration()).getOriginal().getWorkingCopy();
+ } else {
+ wc = getLaunchConfiguration().getWorkingCopy();
+ }
+ } catch (CoreException e) {
+ JDIDebugUIPlugin.errorDialog("Unable to initialize defaults for selected JRE", e);
+ return;
+ }
+ }
+ getDynamicTab().setDefaults(wc);
+ getDynamicTab().initializeFrom(wc);
}
- getDynamicTab().setDefaults(wc);
- getDynamicTab().initializeFrom(wc);
updateLaunchConfigurationDialog();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/J9VMCommandTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/J9VMCommandTab.java
deleted file mode 100644
index 4cb3b56..0000000
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/J9VMCommandTab.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.jdt.internal.debug.ui.launcher;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. and others.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Common Public License v0.5
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v05.html
-
-Contributors:
- IBM Corporation - Initial implementation
-**********************************************************************/
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-
-public class J9VMCommandTab extends AbstractJavaCommandTab {
-
- /**
- * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- Map attributeMap = new HashMap(1);
- attributeMap.put(IJavaLaunchConfigurationConstants.ATTR_JAVA_COMMAND, getCommand());
- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE_SPECIFIC_ATTRS_MAP, attributeMap);
- }
-
- protected String getCommand() {
- return "j9w"; //$NON-NLS-1$
- }
-}