当前位置: 首页>>代码示例>>Java>>正文


Java JavaCommandLine类代码示例

本文整理汇总了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;未经允许,请勿转载。