Consider removing the jdt.launching.macosx.* bundles - moved the Mac VM
install type
diff --git a/org.eclipse.jdt.launching.macosx/.classpath b/org.eclipse.jdt.launching.macosx/.classpath
index 112107e..c835067 100644
--- a/org.eclipse.jdt.launching.macosx/.classpath
+++ b/org.eclipse.jdt.launching.macosx/.classpath
@@ -2,6 +2,5 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="macosx"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.jdt.launching.macosx/META-INF/MANIFEST.MF b/org.eclipse.jdt.launching.macosx/META-INF/MANIFEST.MF
index 36d08bd..a0e42c6 100644
--- a/org.eclipse.jdt.launching.macosx/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.launching.macosx/META-INF/MANIFEST.MF
@@ -15,4 +15,3 @@
Eclipse-PlatformFilter: (osgi.os=macosx)
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.jdt.internal.launching.macosx;x-internal:=true
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXDebugVMRunner.java b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXDebugVMRunner.java
deleted file mode 100644
index 1914a80..0000000
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXDebugVMRunner.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 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.jdt.internal.launching.macosx;
-
-import org.eclipse.jdt.internal.launching.StandardVMDebugger;
-import org.eclipse.jdt.launching.IVMInstall;
-
-/**
- * Special override for MacOSX wrapping
- */
-public class MacOSXDebugVMRunner extends StandardVMDebugger {
-
- /**
- * Constructor
- * @param vmInstance
- */
- public MacOSXDebugVMRunner(IVMInstall vmInstance) {
- super(vmInstance);
- }
-}
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLauncherMessages.properties b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLauncherMessages.properties
deleted file mode 100644
index eac71b9..0000000
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLauncherMessages.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2002, 2010 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:
-# Andre Weinand - Initial implementation
-# Ralf Ebert ralf@ralfebert.de - fix for #307109
-###############################################################################
-
-MacOSXVMType.jvmName= {0}
-MacOSXVMType.jvmDefaultName= {0} (MacOS X Default)
-MacOSXVMType.error.notRoot=Not a JDK Root; MacOS X executable was not found
-MacOSXVMType.name=MacOS X VM
-MacOSXVMType.error.jvmDirectoryNotFound=Java VM default location "{0}" not found, JVMs were not scanned.
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLaunchingPlugin.java b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLaunchingPlugin.java
deleted file mode 100644
index 84ebf42..0000000
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLaunchingPlugin.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 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.jdt.internal.launching.macosx;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Plugin;
-
-
-public class MacOSXLaunchingPlugin extends Plugin {
-
- private static MacOSXLaunchingPlugin fgPlugin;
- private static final String RESOURCE_BUNDLE= "org.eclipse.jdt.internal.launching.macosx.MacOSXLauncherMessages";//$NON-NLS-1$
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- public MacOSXLaunchingPlugin() {
- super();
- Assert.isTrue(fgPlugin == null);
- fgPlugin= this;
- }
-
- public static MacOSXLaunchingPlugin getDefault() {
- return fgPlugin;
- }
-
- static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- /*
- * Convenience method which returns the unique identifier of this plug-in.
- */
- static String getUniqueIdentifier() {
- if (getDefault() == null) {
- // If the default instance is not yet initialized,
- // return a static identifier. This identifier must
- // match the plug-in id defined in plugin.xml
- return "org.eclipse.jdt.launching.macosx"; //$NON-NLS-1$
- }
- return getDefault().getBundle().getSymbolicName();
- }
-}
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMRunner.java b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMRunner.java
deleted file mode 100644
index 3e3b399..0000000
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMRunner.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 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.jdt.internal.launching.macosx;
-
-import org.eclipse.jdt.internal.launching.StandardVMRunner;
-import org.eclipse.jdt.launching.IVMInstall;
-
-public class MacOSXVMRunner extends StandardVMRunner {
-
- /**
- * Constructor
- * @param vmInstance
- */
- public MacOSXVMRunner(IVMInstall vmInstance) {
- super(vmInstance);
- }
-}
diff --git a/org.eclipse.jdt.launching.macosx/plugin.xml b/org.eclipse.jdt.launching.macosx/plugin.xml
index 07c79e4..ecc540f 100644
--- a/org.eclipse.jdt.launching.macosx/plugin.xml
+++ b/org.eclipse.jdt.launching.macosx/plugin.xml
@@ -12,12 +12,5 @@
<plugin>
- <extension
- point="org.eclipse.jdt.launching.vmInstallTypes">
- <vmInstallType
- class="org.eclipse.jdt.internal.launching.macosx.MacOSXVMInstallType"
- id="org.eclipse.jdt.internal.launching.macosx.MacOSXType">
- </vmInstallType>
- </extension>
</plugin>
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.java
index bea5198..efb50c0 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.java
@@ -230,4 +230,8 @@
public static String AbstractVMInstall_4;
+ public static String MacOSXVMInstallType_macosx_default_vm_name;
+
+ public static String MacOSXVMInstallType_mmacosx_vm_type_name;
+
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.properties b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.properties
index 0b05d47..c4c47aa 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.properties
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.properties
@@ -185,6 +185,8 @@
EEVMType_6=Problem with EE file -Dee.source.map property. Library location and source location must be separated by a ''='' character. Entry was: {0}
ExecutionEnvironmentDescription_0=Description file not found {0}
ExecutionEnvironmentDescription_1=Error reading description file {0}
+MacOSXVMInstallType_macosx_default_vm_name={0} (MacOS X Default)
+MacOSXVMInstallType_mmacosx_vm_type_name=MacOS X VM
VMDefinitionsContainer_0=Installed JRE ''{0}'' removed due to missing VM type extension.
VMDefinitionsContainer_2=Installed JRE of type ''{0}'' removed due to missing VM type extension.
VMDefinitionsContainer_3=Installed JRE of type ''{0}'' removed due to missing install path and name.
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstall.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacOSXVMInstall.java
similarity index 84%
rename from org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstall.java
rename to org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacOSXVMInstall.java
index df8d459..06ef73e 100644
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstall.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacOSXVMInstall.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 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
@@ -8,12 +8,11 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.jdt.internal.launching.macosx;
+package org.eclipse.jdt.internal.launching;
import java.io.File;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jdt.internal.launching.StandardVMType;
import org.eclipse.jdt.launching.AbstractVMInstall;
import org.eclipse.jdt.launching.IVMInstallType;
import org.eclipse.jdt.launching.IVMRunner;
@@ -27,21 +26,21 @@
@Override
public IVMRunner getVMRunner(String mode) {
if (ILaunchManager.RUN_MODE.equals(mode))
- return new MacOSXVMRunner(this);
+ return new StandardVMRunner(this);
if (ILaunchManager.DEBUG_MODE.equals(mode))
- return new MacOSXDebugVMRunner(this);
+ return new StandardVMDebugger(this);
return null;
}
-
+
@Override
public String getJavaVersion() {
File installLocation= getInstallLocation();
if (installLocation != null) {
File executable= StandardVMType.findJavaExecutable(installLocation);
if (executable != null) {
- MacOSXVMInstallType installType= (MacOSXVMInstallType) getVMInstallType();
+ MacOSXVMInstallType installType = (MacOSXVMInstallType) getVMInstallType();
String vmVersion= installType.getVMVersion(installLocation, executable);
// strip off extra info
StringBuffer version= new StringBuffer();
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacOSXVMInstallType.java
similarity index 83%
rename from org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java
rename to org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacOSXVMInstallType.java
index 0007690..dc97ad1 100644
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacOSXVMInstallType.java
@@ -10,24 +10,17 @@
* Jeff Myers myersj@gmail.com - fix for #75201
* Ralf Ebert ralf@ralfebert.de - fix for #307109
*******************************************************************************/
-package org.eclipse.jdt.internal.launching.macosx;
+package org.eclipse.jdt.internal.launching;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.text.MessageFormat;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.internal.launching.LaunchingPlugin;
-import org.eclipse.jdt.internal.launching.LibraryInfo;
-import org.eclipse.jdt.internal.launching.MacInstalledJREs;
import org.eclipse.jdt.internal.launching.MacInstalledJREs.JREDescriptor;
-import org.eclipse.jdt.internal.launching.StandardVMType;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.IVMInstallType;
import org.eclipse.jdt.launching.JavaRuntime;
@@ -84,10 +77,18 @@
private static final String JAVADOC_LOC= "/Developer/Documentation/Java/Reference/"; //$NON-NLS-1$
/** The doc for 1.4.1 is kept in a sub directory of the above. */
private static final String JAVADOC_SUBDIR= "/doc/api"; //$NON-NLS-1$
-
+
+ /**
+ * Constant representing the id of the install type
+ * <br><br>
+ * Value is: <code>org.eclipse.jdt.internal.launching.macosx.MacOSXType</code>
+ * @since 3.7.0
+ */
+ public static final String TYPE_ID = "org.eclipse.jdt.internal.launching.macosx.MacOSXType"; //$NON-NLS-1$
+
@Override
public String getName() {
- return MacOSXLaunchingPlugin.getString("MacOSXVMType.name"); //$NON-NLS-1$
+ return LaunchingMessages.MacOSXVMInstallType_mmacosx_vm_type_name;
}
@Override
@@ -115,10 +116,8 @@
if (install == null) {
VMStandin vm= new VMStandin(this, id);
vm.setInstallLocation(home);
- String format= MacOSXLaunchingPlugin.getString(isDefault
- ? "MacOSXVMType.jvmDefaultName" //$NON-NLS-1$
- : "MacOSXVMType.jvmName"); //$NON-NLS-1$
- vm.setName(MessageFormat.format(format, new Object[] { name } ));
+ name = (isDefault ? NLS.bind(LaunchingMessages.MacOSXVMInstallType_macosx_default_vm_name, new Object[] { name }) : name);
+ vm.setName(name);
vm.setLibraryLocations(getDefaultLibraryLocations(home));
vm.setJavadocLocation(getDefaultJavadocLocation(home));
install= vm.convertToRealVM();
@@ -135,7 +134,7 @@
}
return defaultLocation;
} catch (CoreException e) {
- MacOSXLaunchingPlugin.getDefault().getLog().log(e.getStatus());
+ LaunchingPlugin.log(e.getStatus());
return detectInstallLocationOld();
}
}
@@ -154,7 +153,7 @@
}
if (!JVM_VERSIONS_FOLDER.exists() || !JVM_VERSIONS_FOLDER.isDirectory()) {
- String message= NLS.bind(MacOSXLaunchingPlugin.getString("MacOSXVMType.error.jvmDirectoryNotFound"), JVM_VERSIONS_FOLDER); //$NON-NLS-1$
+ String message = NLS.bind("Java VM default location \"{0}\" not found, JVMs were not scanned.", JVM_VERSIONS_FOLDER); //$NON-NLS-1$
LaunchingPlugin.log(message);
return null;
}
@@ -173,10 +172,8 @@
if (install == null) {
VMStandin vm= new VMStandin(this, version);
vm.setInstallLocation(home);
- String format= MacOSXLaunchingPlugin.getString(isDefault
- ? "MacOSXVMType.jvmDefaultName" //$NON-NLS-1$
- : "MacOSXVMType.jvmName"); //$NON-NLS-1$
- vm.setName(MessageFormat.format(format, new Object[] { version } ));
+ String name = (isDefault ? NLS.bind(LaunchingMessages.MacOSXVMInstallType_macosx_default_vm_name, new Object[] { version }) : version);
+ vm.setName(name);
vm.setLibraryLocations(getDefaultLibraryLocations(home));
vm.setJavadocLocation(getDefaultJavadocLocation(home));
@@ -279,18 +276,6 @@
setDefaultRootPath(""); //$NON-NLS-1$
return Path.EMPTY;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.launching.StandardVMType#validateInstallLocation(java.io.File)
- */
- @Override
- public IStatus validateInstallLocation(File javaHome) {
- String id= MacOSXLaunchingPlugin.getUniqueIdentifier();
- File java= new File(javaHome, "bin"+File.separator+"java"); //$NON-NLS-2$ //$NON-NLS-1$
- if (java.isFile())
- return new Status(IStatus.OK, id, 0, "ok", null); //$NON-NLS-1$
- return new Status(IStatus.ERROR, id, 0, MacOSXLaunchingPlugin.getString("MacOSXVMType.error.notRoot"), null); //$NON-NLS-1$
- }
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.launching.StandardVMType#getDefaultJavadocLocation(java.io.File)
@@ -328,12 +313,4 @@
// fall back
return super.getDefaultJavadocLocation(installLocation);
}
-
- /*
- * Overridden to make it visible.
- */
- @Override
- protected String getVMVersion(File javaHome, File javaExecutable) {
- return super.getVMVersion(javaHome, javaExecutable);
- }
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
index 2c4c985..219792c 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
@@ -69,6 +69,7 @@
import org.eclipse.jdt.internal.launching.JavaSourceLookupUtil;
import org.eclipse.jdt.internal.launching.LaunchingMessages;
import org.eclipse.jdt.internal.launching.LaunchingPlugin;
+import org.eclipse.jdt.internal.launching.MacOSXVMInstallType;
import org.eclipse.jdt.internal.launching.RuntimeClasspathEntry;
import org.eclipse.jdt.internal.launching.RuntimeClasspathEntryResolver;
import org.eclipse.jdt.internal.launching.RuntimeClasspathProvider;
@@ -347,10 +348,12 @@
MultiStatus status = new MultiStatus(LaunchingPlugin.getUniqueIdentifier(), IStatus.OK, "Exceptions occurred", null); //$NON-NLS-1$
fgVMTypes = new HashSet<Object>();
for (int i= 0; i < configs.length; i++) {
- try {
- fgVMTypes.add(configs[i].createExecutableExtension("class")); //$NON-NLS-1$
+ if(acceptVMType(configs[i])) {
+ try {
+ fgVMTypes.add(configs[i].createExecutableExtension("class")); //$NON-NLS-1$
+ }
+ catch (CoreException e) {status.add(e.getStatus());}
}
- catch (CoreException e) {status.add(e.getStatus());}
}
if (!status.isOK()) {
//only happens on a CoreException
@@ -363,6 +366,20 @@
}
/**
+ * Returns if we should accept the {@link IConfigurationElement} or not - used to determine
+ * if we should load certain VM install types at startup
+ * @param element the element to check
+ * @return <code>true</code> if we should load the VM install type, <code>false</code> otherwise
+ * @since 3.7.0
+ */
+ static boolean acceptVMType(IConfigurationElement element) {
+ if(!Platform.OS_MACOSX.equals(Platform.getOS()) && MacOSXVMInstallType.TYPE_ID.equals(element.getAttribute("id"))) { //$NON-NLS-1$
+ return false;
+ }
+ return true;
+ }
+
+ /**
* Returns the VM assigned to build the given Java project.
* The project must exist. The VM assigned to a project is
* determined from its build path.
diff --git a/org.eclipse.jdt.launching/plugin.xml b/org.eclipse.jdt.launching/plugin.xml
index a9afc7e..5df02ec 100644
--- a/org.eclipse.jdt.launching/plugin.xml
+++ b/org.eclipse.jdt.launching/plugin.xml
@@ -38,6 +38,10 @@
class="org.eclipse.jdt.internal.launching.EEVMType"
id="org.eclipse.jdt.launching.EEVMType">
</vmInstallType>
+ <vmInstallType
+ class="org.eclipse.jdt.internal.launching.MacOSXVMInstallType"
+ id="org.eclipse.jdt.internal.launching.macosx.MacOSXType">
+ </vmInstallType>
</extension>
<extension
point="org.eclipse.debug.core.launchConfigurationTypes">