cleanup
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
index 6486ea5..7aad162 100644
--- 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
@@ -21,10 +21,10 @@
 		
 		String[] cmdLine2= new String[cmdLine.length + 2];
 		
-		String wrapper= MacOSXLaunchingPlugin.createWrapper(getClass(), "start_carbon.sh");
+		String wrapper= MacOSXLaunchingPlugin.createWrapper(getClass(), "start_carbon.sh");	//$NON-NLS-1$
 		
 		int j= 0;
-		cmdLine2[j++]= "/bin/sh";
+		cmdLine2[j++]= "/bin/sh";	//$NON-NLS-1$
 		cmdLine2[j++]= wrapper;
 		for (int i= 0; i < cmdLine.length; i++)
 			cmdLine2[j++]= cmdLine[i];
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
index a3ae5b9..7bb45eb 100644
--- 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
@@ -4,4 +4,4 @@
 	/**
	 * Constructor for MacOSXLaunchingPlugin
	 */
	public MacOSXLaunchingPlugin(IPluginDescriptor descriptor) {
 		super(descriptor);
 		fgPlugin= this;
	}
-	
	public static MacOSXLaunchingPlugin getDefault() {
		return fgPlugin;
	}
	
	/**
	 * Convenience method which returns the unique identifier of this plugin.
	 */
	public static String getUniqueIdentifier() {
		if (getDefault() == null) {
			// If the default instance is not yet initialized,
			// return a static identifier. This identifier must
			// match the plugin id defined in plugin.xml
			return "org.eclipse.jdt.launching.macosx"; //$NON-NLS-1$
		}
		return getDefault().getDescriptor().getUniqueIdentifier();
	}
	
	static String createWrapper(Class where, String filename) {

		/*
		 * In order to build an application bundle under MacOS X we need a small stub
		 * that reads the various artefacts of a bundle and starts the Java VM. We copy
		 * the stub either from the running Eclipse or from the JavaVM
		 * framework. Here we create the appropriate pathname.
		 */
		String javaApplStub= System.getProperty("sun.boot.library.path");
		int pos= javaApplStub.indexOf(':');
		if (pos > 0)
			javaApplStub= javaApplStub.substring(0, pos);	
		String expected= "/Contents/Resources/Java";
		if (javaApplStub.endsWith(expected)) {
			javaApplStub= javaApplStub.substring(0, javaApplStub.length()-expected.length());
			javaApplStub+= "/Contents/MacOS/*";
		} else {
			javaApplStub= "/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub";
		}
		javaApplStub= "JAVASTUB=\""+ javaApplStub + "\"\n";
		
	
		String output= "/tmp/start_carbon.sh";
		FileOutputStream os= null;
		try {
			os= new FileOutputStream(output);
		} catch (FileNotFoundException ex) {
			return null;
		}
						
		InputStream is= null;
		try {
			os.write("#!/bin/sh\n".getBytes());
			os.write(javaApplStub.getBytes());

			is= where.getResourceAsStream(filename);
			if (is != null) {
				while (true) {
					int c= is.read();
					if (c == -1)
						break;
					os.write(c);
				}
			}
			os.flush();
		} catch (IOException io) {
			return null;
		} finally {
			if (is != null) {
				try {
					is.close();
				} catch (IOException e) {
				}
			}
			try {
				os.close();
			} catch(IOException e) {
			}
		}
		
		return output;
	}
}
+	
	public static MacOSXLaunchingPlugin getDefault() {
		return fgPlugin;
	}
	
	/**
	 * Convenience method which returns the unique identifier of this plugin.
	 */
	public static String getUniqueIdentifier() {
		if (getDefault() == null) {
			// If the default instance is not yet initialized,
			// return a static identifier. This identifier must
			// match the plugin id defined in plugin.xml
			return "org.eclipse.jdt.launching.macosx"; //$NON-NLS-1$
		}
		return getDefault().getDescriptor().getUniqueIdentifier();
	}
	
	static String createWrapper(Class where, String filename) {

		/*
		 * In order to build an application bundle under MacOS X we need a small stub
		 * that reads the various artefacts of a bundle and starts the Java VM. We copy
		 * the stub either from the running Eclipse or from the JavaVM
		 * framework. Here we create the appropriate pathname.
		 */
		String javaApplStub= System.getProperty("sun.boot.library.path");	//$NON-NLS-1$
		int pos= javaApplStub.indexOf(':');
		if (pos > 0)
			javaApplStub= javaApplStub.substring(0, pos);	
		String expected= "/Contents/Resources/Java";	//$NON-NLS-1$
		if (javaApplStub.endsWith(expected)) {
			javaApplStub= javaApplStub.substring(0, javaApplStub.length()-expected.length());
			javaApplStub+= "/Contents/MacOS/Eclipse";	//$NON-NLS-1$
		} else {
			javaApplStub= "/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub"; //$NON-NLS-1$
		}
		javaApplStub= "JAVASTUB=\""+ javaApplStub + "\"\n";	//$NON-NLS-1$ //$NON-NLS-2$
		
	
		String output= "/tmp/start_carbon.sh";	//$NON-NLS-1$
		FileOutputStream os= null;
		try {
			os= new FileOutputStream(output);
		} catch (FileNotFoundException ex) {
			return null;
		}
						
		InputStream is= null;
		try {
			os.write("#!/bin/sh\n".getBytes());	//$NON-NLS-1$
			os.write(javaApplStub.getBytes());

			is= where.getResourceAsStream(filename);
			if (is != null) {
				while (true) {
					int c= is.read();
					if (c == -1)
						break;
					os.write(c);
				}
			}
			os.flush();
		} catch (IOException io) {
			return null;
		} finally {
			if (is != null) {
				try {
					is.close();
				} catch (IOException e) {
				}
			}
			try {
				os.close();
			} catch(IOException e) {
			}
		}
		
		return output;
	}
}
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
index 417ad7c..0063b5a 100644
--- 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
@@ -37,19 +37,11 @@
 		
 		buff.append(command);
 		String program= buff.toString();
-		File exe= new File(program + ".exe"); //$NON-NLS-1$
 		File javaCommand= new File(program); 
-		
-		if (!exe.isFile() && !javaCommand.isFile()) {
-			File java= new File(jdkLocation + "java.exe"); //$NON-NLS-1$
-			if (java.isFile()) {
+		if (!javaCommand.isFile()) {
+			File java= new File(jdkLocation + "java"); //$NON-NLS-1$
+			if (java.isFile())
 				program= java.getAbsolutePath();
-			} else {
-				java= new File(jdkLocation + "java"); //$NON-NLS-1$
-				if (java.isFile()) {
-					program= java.getAbsolutePath();
-				}
-			}
 		}
 		return program;
 	}	
@@ -62,10 +54,10 @@
 		
 		String[] cmdLine2= new String[cmdLine.length + 2];
 		
-		String wrapper= MacOSXLaunchingPlugin.createWrapper(getClass(), "start_carbon.sh");
+		String wrapper= MacOSXLaunchingPlugin.createWrapper(getClass(), "start_carbon.sh");	//$NON-NLS-1$
 		
 		int j= 0;
-		cmdLine2[j++]= "/bin/sh";
+		cmdLine2[j++]= "/bin/sh";	//$NON-NLS-1$
 		cmdLine2[j++]= wrapper;
 		for (int i= 0; i < cmdLine.length; i++)
 			cmdLine2[j++]= cmdLine[i];