gpt4 book ai didi

eclipse - Eclipse 中的全局启动配置?

转载 作者:行者123 更新时间:2023-12-04 01:53:09 25 4
gpt4 key购买 nike

这似乎是一件简单的事情,但我在现有问题中找不到答案:

您如何向所有现有和现有的运行或调试配置添加全局参数?就我而言,我需要一个 VM 参数,但我发现这对于运行线参数也很有用。

基本上,每次创建单元测试时,我都需要创建一个配置(或运行,它会创建一个),然后使用相同的 VM 参数手动编辑每个配置。对于这么好的工具来说,这似乎很愚蠢。

最佳答案

哎哟:7-years bug ,要求运行配置模板,正是出于这种原因或原因。

This thread提出了一个有趣的解决方法,基于复制基于字符串替换的假配置:

  1. You can define variables in Window->Preferences->Run/Debug->String Substitution. For example you can define a projectName_log4j variable with the correct -Dlog4j.configuration=... value.
    In a run configuration you can use ${projectName_log4j} and you don't have to remember the real value.
  2. You can define a project-specific "empty" run configuration.
    Set the project and the arguments fields in this configuration but not the main class. If you have to create a new run configuration for this project select this one and use 'Duplicate' from its popup-menu to copy this configuration.
    You have to simply set the main class and the program arguments.

Also you can combine both solutions: use a variable and define an "empty" run configuration which use this variable. The great advantage in this case is when you begin to use a different log4j config file you have to change only the variable declaration.



不理想,但它可能会减轻您的过程。

关于eclipse - Eclipse 中的全局启动配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3142077/

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