setDefaultSourceLocator(launch, configuration);    runner.run(runConfig, launch, monitor); }
if (! debugMode) { return; }  DebugPlugin.newProcess(launch, process, mode);   try { Thread.sleep(5000); } catch (InterruptedException e) {  }                      if (monitor == null) { monitor = new NullProgressMonitor(); }  monitor.beginTask(MessageFormat.format(MIDletLauncherMessages.AttachingTo, new String[] { configuration.getName() }), 3);   if (monitor.isCanceled()) { return; }  monitor.subTask(MIDletLauncherMessages.VerifyingLaunchAttributes);  String connectorId = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_CONNECTOR, (String) null); IVMConnector connector = null;  if (connectorId == null) { connector = JavaRuntime.getDefaultVMConnector(); } else { connector = JavaRuntime.getVMConnector(connectorId); }  if (connector == null) { abort(MIDletLauncherMessages.ConnectorNotSpecified, null, IJavaLaunchConfigurationConstants.ERR_CONNECTOR_NOT_AVAILABLE); }  Map argMap = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CONNECT_MAP, (Map) null);  int connectTimeout = JavaRuntime.getPreferences().getInt(JavaRuntime.PREF_CONNECT_TIMEOUT); argMap.put("timeout", "" + connectTimeout);   if (monitor.isCanceled()) { return; }  monitor.worked(1);  monitor.subTask(MIDletLauncherMessages.CreatingSourceLocator);   setDefaultSourceLocator(launch, configuration); monitor.worked(1);   connector.connect(argMap, monitor, launch);   if (monitor.isCanceled()) { IDebugTarget[] debugTargets = launch.getDebugTargets(); for (int i = 0; i < debugTargets.length; i++) { IDebugTarget target = debugTargets[i]; if (target.canDisconnect()) { target.disconnect(); } } return; }  monitor.done();  if (process != null) { process.destroy(); }  }
	public void launch(ILaunchConfiguration configuration, String mode,					   ILaunch launch, IProgressMonitor monitor)		throws CoreException	{		// TODO: Implement me.		//		String mainTypeName = verifyMainTypeName(configuration);//		String mainTypeName = "HelloWorld"; 		String mainTypeName = "com.navigon.lithium.LithiumMIDlet";		// TODO: Make sure the main type extends javax.microedition.MIDlet	    IJavaProject javaProject = getJavaProject(configuration);	    IType mainType = getMainType(mainTypeName, javaProject);//	    IVMInstall vm = verifyVMInstall(configuration);//	    IVMRunner runner = vm.getVMRunner(mode);	    	    IVMRunner runner = null;	    if ("debug".equals(mode))	    {//	    	runner = new MIDletListeningDebugRunner();	    	runner = new MIDletAttachingDebugRunner();	    }	    else	    {	    	runner = new MIDletRunner();	    }	    	    VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName,	    															getClasspath(configuration));//	    String[] vmArgs = runConfig.getVMArguments();//	    String[] realArgs = new String[vmArgs.length+1];//	    System.arraycopy(vmArgs, 0, realArgs, 1, vmArgs.length);//	    realArgs[0] = javaPolicy;//	    runConfig.setVMArguments(realArgs);//	    runConfig.setVMArguments(vmArgs);	       //	    runConfig.setWorkingDirectory(workingDirName);	    // Bootpath	    String[] bootpath = getBootpath(configuration);	    runConfig.setBootClassPath(bootpath);	    // TODO: Might not be needed accorind to javadocs.	    setDefaultSourceLocator(launch, configuration);	    	    // Launch the configuration//	    this.fCurrentLaunchConfiguration = configuration;	    runner.run(runConfig, launch, monitor); 	}