• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java VMRunnerConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.jdt.launching.VMRunnerConfiguration的典型用法代码示例。如果您正苦于以下问题:Java VMRunnerConfiguration类的具体用法?Java VMRunnerConfiguration怎么用?Java VMRunnerConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VMRunnerConfiguration类属于org.eclipse.jdt.launching包,在下文中一共展示了VMRunnerConfiguration类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getWorkingDir

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
/**
 * Gets the work dir.
 * 
 * @param config
 * @return
 * @throws CoreException
 */
protected File getWorkingDir( VMRunnerConfiguration config )
		throws CoreException
{
	String path = config.getWorkingDirectory( );
	if ( path == null )
	{
		return null;
	}
	File dir = new File( path );
	if ( !dir.isDirectory( ) )
	{
		throw new Error( "Workking directory is null" );//$NON-NLS-1$
	}
	return dir;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:AbstractScriptVMRunner.java


示例2: getWorkingDir

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
/**
 * 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.
 * 
 * @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(
				MessageFormat
						.format(
								HyLauncherMessages
										.getString("javaVMRunner.Specified_working_directory_does_not_exist_or_is_not_a_directory__{0}_1"), new String[] { path }), null, IJavaLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST); //$NON-NLS-1$
	}
	return dir;
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:27,代码来源:JavaVMRunner.java


示例3: constructProgramString

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
protected String constructProgramString(String location, VMRunnerConfiguration config) {
	String command= null;
	Map map= config.getVMSpecificAttributesMap();
	if (map != null) {
		command= (String)map.get(IJavaLaunchConfigurationConstants.ATTR_JAVA_COMMAND);
	}
	
	StringBuffer program= new StringBuffer();
	program.append(location).append(File.separator).append("bin").append(File.separator); //$NON-NLS-1$
	int directoryLength= program.length();
	if (command == null) {
		program.append("javaw.exe"); //$NON-NLS-1$
		File javaw= new File(program.toString());
		if (!javaw.exists()) {
			program.replace(directoryLength, program.length(), "java"); //$NON-NLS-1$
		}
	} else {
		program.append(command);
	}
	
	return program.toString();
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:23,代码来源:HyVMRunner.java


示例4: runVM

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
/**
 * @param label
 * @param classToLaunch
 * @param classpath
 * @param bootClasspath
 * @param vmArgs
 * @param prgArgs
 * @param workDir
 * @param sourceLocator
 * @param debug
 * @param showInDebugger
 * @throws CoreException
 */
public void runVM(final String label, final String classToLaunch, final String[] classpath, final String[] bootClasspath, final String[] vmArgs,
        final String[] prgArgs, final String workDir, final ISourceLocator sourceLocator, final boolean debug, final boolean showInDebugger)
        throws CoreException {
    final IVMInstall vmInstall = this.getVMInstall();
    String mode = ILaunchManager.DEBUG_MODE;
    if (debug && classToLaunch.equals(WEBLOGIC_MAIN_CLASS)) {
        mode = ILaunchManager.DEBUG_MODE;
    } else {
        mode = ILaunchManager.RUN_MODE;
    }
    final IVMRunner vmRunner = vmInstall.getVMRunner(mode);

    final ILaunchConfigurationType launchType = DebugPlugin.getDefault().getLaunchManager()
            .getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
    final ILaunchConfigurationWorkingCopy config = launchType.newInstance(null, label);
    config.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
    config.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector");
    DebugUITools.setLaunchPerspective(launchType, mode, IDebugUIConstants.PERSPECTIVE_DEFAULT);
    final Launch launch = new Launch(config, mode, sourceLocator);

    config.doSave();
    if (vmRunner != null) {
        final VMRunnerConfiguration vmConfig = new VMRunnerConfiguration(classToLaunch, classpath);
        vmConfig.setVMArguments(vmArgs);
        vmConfig.setProgramArguments(prgArgs);
        if (workDir != null) {
            vmConfig.setWorkingDirectory(workDir);
        }
        if (bootClasspath.length == 0) {
            vmConfig.setBootClassPath(null);
        } else {
            vmConfig.setBootClassPath(bootClasspath);
        }
        vmRunner.run(vmConfig, launch, null);
    }
    if (showInDebugger) {
        DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
    }
}
 
开发者ID:rajendarreddyj,项目名称:eclipse-weblogic-plugin,代码行数:53,代码来源:WeblogicLauncher.java


示例5: createDebugTarget

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
@Override
protected IDebugTarget createDebugTarget(final VMRunnerConfiguration config,
    final ILaunch launch, final int port, final IProcess process, final VirtualMachine vm)
{
  if (vm != null && vm.version() != null && "1.6".compareTo(vm.version()) > 0)
  {
    System.err.format(JiveLaunchPlugin.VERSION_WARNING, vm.version());
  }
  final IJiveLaunchFactory factory = LaunchFactory.createFactory(launch.getLaunchConfiguration());
  final IJiveProject project = factory.createJiveProject(launch);
  return JiveDebugPlugin.createDebugTarget(launch, vm,
      renderDebugTarget(config.getClassToLaunch(), port), process, true, false,
      config.isResumeOnStartup(), project);
}
 
开发者ID:UBPL,项目名称:jive,代码行数:15,代码来源:JiveVMDebugger.java


示例6: constructProgramString

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
/**
 * @param config
 * @return
 * @throws CoreException
 */
protected String constructProgramString( VMRunnerConfiguration config )
		throws CoreException
{
	File exe = ScriptDebugUtil.findJavaExecutable( fVMInstance.getInstallLocation( ) );
	if ( exe == null )
	{
		throw new Error( "not java exe file" );//$NON-NLS-1$
	}
	return exe.getAbsolutePath( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:16,代码来源:AbstractScriptVMRunner.java


示例7: run

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
public void run( VMRunnerConfiguration configuration, ILaunch launch,
		IProgressMonitor monitor ) throws CoreException
{
	delegate.run( configuration, launch, monitor );

	IProcess[] ps = launch.getProcesses( );

	if ( ps != null && ps.length > 0 )
	{
		if ( runScript )
		{
			if ( monitor == null )
			{
				monitor = new NullProgressMonitor( );
			}

			IProgressMonitor subMonitor = new SubProgressMonitor( monitor,
					1 );
			subMonitor.beginTask( "Launching VM...", 1 ); //$NON-NLS-1$

			ReportVMClient vm = new ReportVMClient( );
			ScriptDebugTarget target = new ScriptDebugTarget( launch,
					vm,
					null,
					ps[0],
					config.helper.listenPort,
					config.helper.tempFolder );
			target.setFileName( config.helper.fileName );

			subMonitor.worked( 1 );
			subMonitor.done( );
		}

		ReportLaunchHelper.handleProcessTermination( launch,
				ps[0],
				config.helper.fileName,
				config.helper.tempFolder );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:40,代码来源:ReportDebuggerVMRunner.java


示例8: addBootClassPathArguments

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
protected void addBootClassPathArguments(List arguments,
		VMRunnerConfiguration config) {
	Map map = config.getVMSpecificAttributesMap();
	if (map == null) {
		return;
	}
	String[] prependBootCP = (String[]) map
			.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH_PREPEND);
	String[] bootCP = (String[]) map
			.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH);
	String[] appendBootCP = (String[]) map
			.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH_APPEND);
	if (prependBootCP == null && bootCP == null && appendBootCP == null) {
		// use old single attribute instead of new attributes if not
		// specified
		bootCP = config.getBootClassPath();
	}
	if (prependBootCP != null) {
		arguments
				.add("-Xbootclasspath/p:" + convertClassPath(prependBootCP)); //$NON-NLS-1$
	}
	if (bootCP != null) {
		if (bootCP.length > 0) {
			arguments.add("-Xbootclasspath:" + convertClassPath(bootCP)); //$NON-NLS-1$
		} else {
			// empty
			arguments.add("-Xbootclasspath:"); //$NON-NLS-1$	
		}
	}
	if (appendBootCP != null) {
		arguments
				.add("-Xbootclasspath/a:" + convertClassPath(appendBootCP)); //$NON-NLS-1$
	}
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:35,代码来源:JavaVMRunner.java


示例9: run

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
public void run( VMRunnerConfiguration configuration, ILaunch launch,
		IProgressMonitor monitor ) throws CoreException
{
	// donothing now see delegate
}
 
开发者ID:eclipse,项目名称:birt,代码行数:6,代码来源:AbstractScriptVMRunner.java


示例10: run

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
/**
 * @see org.eclipse.jdt.launching.IVMRunner#run(VMRunnerConfiguration, ILaunch, IProgressMonitor)
 */
public void run(VMRunnerConfiguration config, ILaunch launch, IProgressMonitor monitor) throws CoreException {
	
	if (monitor == null) {
		monitor = new NullProgressMonitor();
	}
	
	// check for cancellation
	if (monitor.isCanceled()) {
		return;
	}
	
	IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
	subMonitor.beginTask(HyLauncherMessages.getString("HyVMRunner.Launching_virtual_machine..._1"), 2); //$NON-NLS-1$
	subMonitor.subTask(HyLauncherMessages.getString("HyVMRunner.Constructing_command_line..._2"));	 //$NON-NLS-1$
	
	File workingDir = getWorkingDir(config);
	String location= getJDKLocation();
	String program = constructProgramString(location, config);
	List arguments= new ArrayList();

	arguments.add(program);
	
	addBootClassPathArguments(arguments, config);

	String[] cp= config.getClassPath();
	if (cp.length > 0) {
		arguments.add("-classpath"); //$NON-NLS-1$
		arguments.add(convertClassPath(cp));
	}
	String[] vmArgs= config.getVMArguments();
	addArguments(vmArgs, arguments);
	
	arguments.add(config.getClassToLaunch());
	
	String[] programArgs= config.getProgramArguments();
	addArguments(programArgs, arguments);
			
	String[] cmdLine= new String[arguments.size()];
	arguments.toArray(cmdLine);
	
	String[] envp= config.getEnvironment();
	
	// check for cancellation
	if (monitor.isCanceled()) {
		return;
	}
	
	subMonitor.worked(1);
	subMonitor.subTask(HyLauncherMessages.getString("HyVMRunner.Starting_virtual_machine..._3")); //$NON-NLS-1$
	
	Process p= exec(cmdLine, workingDir, envp);
	if (p != null) {
		// Log the current launch command to the platform log
		logLaunchCmd(cmdLine, false);
		if (HyLaunchingPlugin.getDefault().isDebugging()
				&& (Platform
						.getDebugOption(HyLaunchingPlugin.DEBUG_LAUNCHING)
						.equalsIgnoreCase("true"))) { //$NON-NLS-1$
			traceLaunchCmd(cmdLine, envp, false);
		}
		
		IProcess process= newProcess(launch, p, renderProcessLabel(cmdLine), getDefaultProcessMap());
		process.setAttribute(IProcess.ATTR_CMDLINE, renderCommandLine(cmdLine));
	}
	subMonitor.worked(1);
	subMonitor.done();
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:71,代码来源:HyVMRunner.java


示例11: createDebugTarget

import org.eclipse.jdt.launching.VMRunnerConfiguration; //导入依赖的package包/类
/**
 * Creates a new debug target for the given virtual machine and system
 * process that is connected on the specified port for the given launch.
 * 
 * @param config
 *            run configuration used to launch the VM
 * @param launch
 *            launch to add the target to
 * @param port
 *            port the VM is connected to
 * @param process
 *            associated system process
 * @param vm
 *            JDI virtual machine
 */
private IDebugTarget createDebugTarget( VMRunnerConfiguration config,
		ILaunch launch, int port, IProcess process, VirtualMachine vm )
{
	String debugName = "Report Running at localhost:" //$NON-NLS-1$
			+ port;

	return JDIDebugModel.newDebugTarget( launch,
			vm,
			debugName,
			process,
			true,
			false,
			config.isResumeOnStartup( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:30,代码来源:StandardScriptVMRunner.java



注:本文中的org.eclipse.jdt.launching.VMRunnerConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MethodHandlesTest类代码示例发布时间:2022-05-22
下一篇:
Java OCSPResponse类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap