一次运行多个启动配置

发布于 2024-09-29 23:35:19 字数 99 浏览 5 评论 0原文

我在 Eclipse 中有多个启动配置,每个配置启动相同的 Java 程序,但参数不同。

现在是否可以一次运行所有这些(只需单击一下鼠标),而不是单独选择每个并启动它?

I have several launch configurations in Eclipse each launching the same Java program but with different parameters.

Now is it possible to run all of these at once (with one mouse click) instead of selecting each of it separately and launching it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

洛阳烟雨空心柳 2024-10-06 23:35:19

编辑:根据这个答案,自 Eclipse Oxygen (4.7.0) 以来,您可以使用运行类型启动组的配置。


只需从 CDT 安装“C/C++ 开发工具”(请参阅​​ eclipse.org/cdt/downloads.php ) - 这个单个包就足够了,不需要其他 CDT 包。这不会干扰您的 Java 环境;-) 然后您将拥有“启动组”,适用于任何类型的项目,包括 Java 项目。请参见以下屏幕截图:

在此处输入图像描述

您可以运行或调试项目(也是混合模式)、定义延迟时间和很快。玩得开心!

EDIT: According to this answer since Eclipse Oxygen (4.7.0) you can use a run configuration of the type Launch Group for that.


Just install "C/C++ Development Tools" from the CDT (see eclipse.org/cdt/downloads.php ) - this single package is enough, no other CDT packages are needed. This won't disturb your Java environment ;-) Then you have "Launch Groups", for any kind of project, including Java projects. See the following screenshot:

enter image description here

You can run or debug the projects (also mixed mode), define delay times and so on. Have fun!

还如梦归 2024-10-06 23:35:19

我在 Eclipse 跟踪器上找到了这篇文章: Start multiple debugconfiguration at Once

虽然它讨论了多启动调试配置,但我认为它同样适用于运行配置。

启动组

您可能需要右键单击组启动中的运行配置并对其进行配置。

启动顺序

I found this post on the Eclipse trackers: Start multiple debug configurations at once

While it talks about multi-launching debug configurations, I think it is just as applicable to run configurations.

Launch Group

You may want to right click a run configuration in group launch and configure it.

Launch sequential

稳稳的幸福 2024-10-06 23:35:19

自 Eclipse Oxygen (4.7.0) 起,您可以使用 启动组 类型的运行配置。

这段简短视频展示了如何使用启动组 .

Since Eclipse Oxygen (4.7.0) you can use a run configuration of the type Launch Group for that.

This short video shows how to use a Launch Group.

贪了杯 2024-10-06 23:35:19

从 ANT 启动 Eclipse 运行配置中列出了另外两个选项。

您可以在 Ant 中将它们分组,然后使用 Ant4Eclipse 调用它们。或者使用 eclipse 远程控制 从命令脚本调用多个启动配置。

There are two more options listed in Launch an Eclipse Run Configuration from ANT.

You could group them in Ant and then call them using Ant4Eclipse. Or call multiple launch configs from a command script using eclipse remote control.

無心 2024-10-06 23:35:19

您可以创建一个单独的类,使用不同的参数调用您的程序,然后运行它。

public class YourClass {
    public static void main(String arg){
        System.out.println(arg);
    }
}

public class YourClassTester {
    public static void main(String[] args){
        YourClass.main("SomeArg1");
        YourClass.main("SomeArg2");
        YourClass.main("SomeArg3");
    }
}

You can create a separate class that calls your program with different arguments, and run it instead.

public class YourClass {
    public static void main(String arg){
        System.out.println(arg);
    }
}

public class YourClassTester {
    public static void main(String[] args){
        YourClass.main("SomeArg1");
        YourClass.main("SomeArg2");
        YourClass.main("SomeArg3");
    }
}
伴我老 2024-10-06 23:35:19

您不需要任何插件:

  1. 在 eclipse 中创建所有运行配置
  2. 选择组织收藏夹...
  3. 添加您的收藏夹,完成

Screenshot

You don't need any plugin:

  1. Create all Run Configurations in eclipse
  2. Select Organize Favorites...
  3. Add you favorites, done

Screenshot

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文