@Override public IVMRunner getVMRunner(String mode) { if (ILaunchManager.RUN_MODE.equals(mode)) { return new StandardVMRunner(this); } else if (ILaunchManager.DEBUG_MODE.equals(mode)) { return new StandardVMDebugger(this); } return null; }
/** * Returns the working directory to use for the launched VM, * or <code>null</code> if the working directory is to be inherited * from the current process. * * @param config the VM configuration * @return the working directory to use * @exception CoreException if the working directory specified by * the configuration does not exist or is not a directory */ protected File getWorkingDir(VMRunnerConfiguration config) throws CoreException { String path = config.getWorkingDirectory(); if (path == null) { return null; } File dir = new File(path); if (!dir.isDirectory()) { abort(NLS.bind(LaunchingMessages.StandardVMRunner_Specified_working_directory_does_not_exist_or_is_not_a_directory___0__3, new String[] {path}), null, IJavaLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST); } return dir; }
arguments.add("-Xbootclasspath/p:" + convertClassPath(prependBootCP)); //$NON-NLS-1$ arguments.add("-Xbootclasspath:" + convertClassPath(bootCP)); //$NON-NLS-1$ arguments.add("-Xbootclasspath/a:" + convertClassPath(appendBootCP)); //$NON-NLS-1$
String program= constructProgramString(config); String[] allVMArgs = combineVmArgs(config, fVMInstance); addArguments(ensureEncoding(launch, allVMArgs), arguments); addBootClassPathArguments(arguments, config); cpidx = arguments.size(); arguments.add("-classpath"); //$NON-NLS-1$ arguments.add(convertClassPath(cp)); addArguments(programArgs, arguments); String[] envp = prependJREPath(config.getEnvironment()); String[] newenvp = checkClasspath(arguments, cp, envp); if(newenvp != null) { envp = newenvp; File workingDir = getWorkingDir(config); String[] newCmdLine = validateCommandLine(launch.getLaunchConfiguration(), cmdLine); if(newCmdLine != null) { cmdLine = newCmdLine; p= exec(cmdLine, workingDir, envp); if (p == null) { return; IProcess process= newProcess(launch, p, renderProcessLabel(cmdLine, timestamp), getDefaultProcessMap());
String program = constructProgramString(config); String[] allVMArgs = combineVmArgs(config, fVMInstance); addArguments(ensureEncoding(launch, allVMArgs), arguments); addBootClassPathArguments(arguments, config); arguments.add(convertClassPath(mp)); arguments.add(convertClassPath(cp)); if (isModular(config, fVMInstance)) { arguments.add("-m"); //$NON-NLS-1$ arguments.add(config.getModuleDescription() + "/" + config.getClassToLaunch()); //$NON-NLS-1$ addArguments(programArgs, arguments); String[] envp = prependJREPath(config.getEnvironment()); File workingDir = getWorkingDir(config); ClasspathShortener classpathShortener = new ClasspathShortener(fVMInstance, launch, cmdLine, lastVMArgumentIndex, workingDir, envp); if (classpathShortener.shortenCommandLineIfNecessary()) { envp = classpathShortener.getEnvp(); String[] newCmdLine = validateCommandLine(launch.getLaunchConfiguration(), cmdLine); if (newCmdLine != null) { cmdLine = newCmdLine;
CommandDetails cmdDetails = getCommandLine(config, launch, monitor); subMonitor.subTask(LaunchingMessages.StandardVMRunner_Starting_virtual_machine____3); Process p= null; p = exec(cmdLine, cmdDetails.getWorkingDir(), cmdDetails.getEnvp()); if (p == null) { return; IProcess process= newProcess(launch, p, renderProcessLabel(cmdLine, timestamp), getDefaultProcessMap()); process.setAttribute(DebugPlugin.ATTR_PATH, cmdLine[0]); process.setAttribute(IProcess.ATTR_CMDLINE, renderCommandLine(cmdLine)); String ltime = launch.getAttribute(DebugPlugin.ATTR_LAUNCH_TIMESTAMP); process.setAttribute(DebugPlugin.ATTR_LAUNCH_TIMESTAMP, ltime != null ? ltime : timestamp);
abort(NLS.bind(LaunchingMessages.StandardVMRunner_Unable_to_locate_executable_for__0__1, new String[]{fVMInstance.getName()}), null, IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR); } else { return exe.getAbsolutePath(); if (fileExists(exe)){ return exe.getAbsolutePath(); if (fileExists(exe)){ return exe.getAbsolutePath(); if (fileExists(exe)) { return exe.getAbsolutePath(); if (fileExists(exe)) { return exe.getAbsolutePath(); abort(NLS.bind(LaunchingMessages.StandardVMRunner_Specified_executable__0__does_not_exist_for__1__4, new String[]{command, fVMInstance.getName()}), null, IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
/** * Adds in special command line arguments if SWT or the <code>-ws</code> directive * are used * * @param config the backing {@link ILaunchConfiguration} * @param cmdLine the original VM arguments * @return the (possibly) modified command line to launch with * @throws CoreException */ private String[] wrap(ILaunchConfiguration config, String[] cmdLine) throws CoreException { if(config != null && Platform.OS_MACOSX.equals(Platform.getOS())) { for (int i= 0; i < cmdLine.length; i++) { if ("-ws".equals(cmdLine[i]) || cmdLine[i].indexOf("swt.jar") > -1 || cmdLine[i].indexOf("org.eclipse.swt") > -1) { //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ return createSWTlauncher(cmdLine, cmdLine[0], config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_USE_START_ON_FIRST_THREAD, true)); } } } return cmdLine; }
abort(NLS.bind(LaunchingMessages.StandardVMRunner_Unable_to_locate_executable_for__0__1, new String[]{fVMInstance.getName()}), null, IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR); } else { return exe.getAbsolutePath(); if (fileExists(exe)){ return exe.getAbsolutePath(); if (fileExists(exe)){ return exe.getAbsolutePath(); if (fileExists(exe)) { return exe.getAbsolutePath(); if (fileExists(exe)) { return exe.getAbsolutePath(); abort(NLS.bind(LaunchingMessages.StandardVMRunner_Specified_executable__0__does_not_exist_for__1__4, new String[]{command, fVMInstance.getName()}), null, IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
/** * Adds in special command line arguments if SWT or the <code>-ws</code> directive * are used * * @param config the backing {@link ILaunchConfiguration} * @param cmdLine the original VM arguments * @return the (possibly) modified command line to launch with * @throws CoreException */ private String[] wrap(ILaunchConfiguration config, String[] cmdLine) throws CoreException { if(config != null && Platform.OS_MACOSX.equals(Platform.getOS())) { for (int i= 0; i < cmdLine.length; i++) { if ("-ws".equals(cmdLine[i]) || cmdLine[i].indexOf("swt.jar") > -1 || cmdLine[i].indexOf("org.eclipse.swt") > -1) { //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ return createSWTlauncher(cmdLine, cmdLine[0], config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_USE_START_ON_FIRST_THREAD, true)); } } } return cmdLine; }
@Override public IVMRunner getVMRunner(String mode) { if (ILaunchManager.RUN_MODE.equals(mode)) { return new StandardVMRunner(this); } else if (ILaunchManager.DEBUG_MODE.equals(mode)) { return new StandardVMDebugger(this); } return null; }
/** * Returns the working directory to use for the launched VM, * or <code>null</code> if the working directory is to be inherited * from the current process. * * @param config the VM configuration * @return the working directory to use * @exception CoreException if the working directory specified by * the configuration does not exist or is not a directory */ protected File getWorkingDir(VMRunnerConfiguration config) throws CoreException { String path = config.getWorkingDirectory(); if (path == null) { return null; } File dir = new File(path); if (!dir.isDirectory()) { abort(NLS.bind(LaunchingMessages.StandardVMRunner_Specified_working_directory_does_not_exist_or_is_not_a_directory___0__3, new String[] {path}), null, IJavaLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST); } return dir; }
arguments.add("-Xbootclasspath/p:" + convertClassPath(prependBootCP)); //$NON-NLS-1$ arguments.add("-Xbootclasspath:" + convertClassPath(bootCP)); //$NON-NLS-1$ arguments.add("-Xbootclasspath/a:" + convertClassPath(appendBootCP)); //$NON-NLS-1$