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

Java JavaCommandLine类代码示例

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

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



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

示例1: createCommandLineProxy

import com.intellij.execution.configurations.JavaCommandLine; //导入依赖的package包/类
public ProcessProxy createCommandLineProxy(final JavaCommandLine javaCmdLine) throws ExecutionException {
  ProcessProxyImpl proxy = null;
  final JavaParameters javaParameters = javaCmdLine.getJavaParameters();
  String mainClass = javaParameters.getMainClass();
  if (ProcessProxyImpl.useLauncher() && mainClass != null) {
    try {
      proxy = new ProcessProxyImpl();
      JavaSdkUtil.addRtJar(javaParameters.getClassPath());
      final ParametersList vmParametersList = javaParameters.getVMParametersList();
      vmParametersList.defineProperty(ProcessProxyImpl.PROPERTY_PORT_NUMBER, String.valueOf(proxy.getPortNumber()));
      vmParametersList.defineProperty(ProcessProxyImpl.PROPERTY_BINPATH, PathManager.getBinPath());
      javaParameters.getProgramParametersList().prepend(mainClass);
      javaParameters.setMainClass(ProcessProxyImpl.LAUNCH_MAIN_CLASS);
    }
    catch (ProcessProxyImpl.NoMoreSocketsException e) {
      proxy = null;
    }
  }
  return proxy;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ProcessProxyFactoryImpl.java


示例2: createCommandLineProxy

import com.intellij.execution.configurations.JavaCommandLine; //导入依赖的package包/类
public ProcessProxy createCommandLineProxy(final JavaCommandLine javaCmdLine) throws ExecutionException {
  ProcessProxyImpl proxy = null;
  if (ProcessProxyImpl.useLauncher()) {
    try {
      proxy = new ProcessProxyImpl();
      final JavaParameters javaParameters = javaCmdLine.getJavaParameters();
      JavaSdkUtil.addRtJar(javaParameters.getClassPath());
      final ParametersList vmParametersList = javaParameters.getVMParametersList();
      vmParametersList.defineProperty(ProcessProxyImpl.PROPERTY_PORT_NUMBER, String.valueOf(proxy.getPortNumber()));
      vmParametersList.defineProperty(ProcessProxyImpl.PROPERTY_BINPATH, PathManager.getBinPath());
      javaParameters.getProgramParametersList().prepend(javaParameters.getMainClass());
      javaParameters.setMainClass(ProcessProxyImpl.LAUNCH_MAIN_CLASS);
    }
    catch (ProcessProxyImpl.NoMoreSocketsException e) {
      proxy = null;
    }
  }
  return proxy;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:ProcessProxyFactoryImpl.java


示例3: getRunJre

import com.intellij.execution.configurations.JavaCommandLine; //导入依赖的package包/类
@Nullable
@Override
public Sdk getRunJre()
{
	if(state instanceof JavaCommandLine)
	{
		try
		{
			return ((JavaCommandLine) state).getJavaParameters().getJdk();
		}
		catch(ExecutionException ignore)
		{
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:DefaultDebugEnvironment.java


示例4: createExecutionResult

import com.intellij.execution.configurations.JavaCommandLine; //导入依赖的package包/类
@Override
public ExecutionResult createExecutionResult() throws ExecutionException
{
	// debug port may have changed, reinit parameters just in case
	if(myNeedParametersSet && state instanceof JavaCommandLine)
	{
		DebuggerManagerImpl.createDebugParameters(((JavaCommandLine) state).getJavaParameters(), true, DebuggerSettings.SOCKET_TRANSPORT, myRemoteConnection.getAddress(), false);
	}
	return state.execute(environment.getExecutor(), environment.getRunner());
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:11,代码来源:DefaultDebugEnvironment.java


示例5: createCommandLineProxy

import com.intellij.execution.configurations.JavaCommandLine; //导入依赖的package包/类
@Nullable
public abstract ProcessProxy createCommandLineProxy(JavaCommandLine javaCmdLine) throws ExecutionException;
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:ProcessProxyFactory.java


示例6: doExecute

import com.intellij.execution.configurations.JavaCommandLine; //导入依赖的package包/类
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException
{
	FileDocumentManager.getInstance().saveAllDocuments();

	ExecutionResult executionResult;
	boolean shouldAddDefaultActions = true;
	if(state instanceof JavaCommandLine)
	{
		final OwnJavaParameters parameters = ((JavaCommandLine) state).getJavaParameters();
		patch(parameters, env.getRunnerSettings(), env.getRunProfile(), true);

		ProcessProxy proxy = ProcessProxyFactory.getInstance().createCommandLineProxy((JavaCommandLine) state);
		executionResult = state.execute(env.getExecutor(), this);
		if(proxy != null)
		{
			ProcessHandler handler = executionResult != null ? executionResult.getProcessHandler() : null;
			if(handler != null)
			{
				proxy.attach(handler);
				handler.addProcessListener(new ProcessAdapter()
				{
					@Override
					public void processTerminated(@NotNull ProcessEvent event)
					{
						proxy.destroy();
					}
				});
			}
			else
			{
				proxy.destroy();
			}
		}

		if(state instanceof JavaCommandLineState && !((JavaCommandLineState) state).shouldAddJavaProgramRunnerActions())
		{
			shouldAddDefaultActions = false;
		}
	}
	else
	{
		executionResult = state.execute(env.getExecutor(), this);
	}

	if(executionResult == null)
	{
		return null;
	}

	onProcessStarted(env.getRunnerSettings(), executionResult);

	final RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, env);
	if(shouldAddDefaultActions)
	{
		addDefaultActions(contentBuilder, executionResult);
	}
	return contentBuilder.showRunContent(env.getContentToReuse());
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:59,代码来源:DefaultJavaProgramRunner.java


示例7: createCommandLineProxy

import com.intellij.execution.configurations.JavaCommandLine; //导入依赖的package包/类
@Override
public ProcessProxy createCommandLineProxy(JavaCommandLine javaCmdLine) throws ExecutionException
{
	OwnJavaParameters javaParameters = javaCmdLine.getJavaParameters();
	String mainClass = javaParameters.getMainClass();

	if(ourMayUseLauncher && mainClass != null)
	{
		String rtJarPath = JavaSdkUtil.getJavaRtJarPath();
		boolean runtimeJarFile = new File(rtJarPath).isFile();

		if(runtimeJarFile || javaParameters.getModuleName() == null)
		{
			try
			{
				ProcessProxyImpl proxy = new ProcessProxyImpl(StringUtil.getShortName(mainClass));
				String port = String.valueOf(proxy.getPortNumber());
				String binPath = new File(PluginManager.getPluginPath(JavaClassNames.class), "breakgen").getPath();

				if(runtimeJarFile && JavaSdkUtil.isJdkAtLeast(javaParameters.getJdk(), JavaSdkVersion.JDK_1_5))
				{
					javaParameters.getVMParametersList().add("-javaagent:" + rtJarPath + '=' + port + ':' + binPath);
				}
				else
				{
					JavaSdkUtil.addRtJar(javaParameters.getClassPath());

					ParametersList vmParametersList = javaParameters.getVMParametersList();
					vmParametersList.defineProperty(AppMainV2.LAUNCHER_PORT_NUMBER, port);
					vmParametersList.defineProperty(AppMainV2.LAUNCHER_BIN_PATH, binPath);

					javaParameters.getProgramParametersList().prepend(mainClass);
					javaParameters.setMainClass(AppMainV2.class.getName());
				}

				return proxy;
			}
			catch(Exception e)
			{
				Logger.getInstance(ProcessProxy.class).warn(e);
			}
		}
	}

	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:47,代码来源:ProcessProxyFactoryImpl.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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