gpt4 book ai didi

java - Eclipse:如何以编程方式执行启动配置?

转载 作者:搜寻专家 更新时间:2023-10-31 20:30:04 25 4
gpt4 key购买 nike

我的 Eclipse 项目中有各种启动配置文件。有什么方法可以以编程方式执行任意启动配置吗?

最佳答案

       ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();

ILaunchConfigurationType type = manager.getLaunchConfigurationType("org.eclipse.cdt.launch.applicationLaunchType");
ILaunchConfiguration[] lcs = manager.getLaunchConfigurations(type);

for (ILaunchConfiguration iLaunchConfiguration : lcs) {
if (iLaunchConfiguration.getName().equals("Test PThread")) {
ILaunchConfigurationWorkingCopy t = iLaunchConfiguration.getWorkingCopy();
ILaunchConfiguration config = t.doSave();
if (config != null) {
// config.launch(ILaunchManager.RUN_MODE, null);
DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
}
}
}

关于java - Eclipse:如何以编程方式执行启动配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10104238/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com