默认 eclipse 工作目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/981213/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Default eclipse working directory
提问by Hyman Ha
Is it possible to set a default working directory in Eclipse 3.4.1? By Default that is:
是否可以在 Eclipse 3.4.1 中设置默认工作目录?默认情况下,即:
${workspace_loc:(project name)}
${workspace_loc:(项目名称)}
But I want it to be something like
但我希望它像
${custom_var}
${custom_var}
Per class, I can change the Run configuration -> arguments -> Working directory to "Other", but it's better if the default can be changed. I have a lot of classes that needs to be run from that particular directory.
对于每个类,我可以将运行配置 -> 参数 -> 工作目录更改为“其他”,但如果可以更改默认值会更好。我有很多类需要从该特定目录运行。
采纳答案by Scott Stanchfield
One thing you can do is set up one launch configuration and then right-click it and choose "duplicate". This will keep all the arguments.
您可以做的一件事是设置一个启动配置,然后右键单击它并选择“复制”。这将保留所有参数。
Not perfect, but AFAIK there is no way to change the default working dir, though.
不完美,但 AFAIK 无法更改默认工作目录。
You can also set the dir you want as a string substitution (Window->Preferences->Run/Debug->String Substitution) and then use that variable in each run config - you'll still have to set it but instead of picking the dir each time you just choose the variable.
您还可以将您想要的目录设置为字符串替换(窗口->首选项->运行/调试->字符串替换),然后在每个运行配置中使用该变量 - 您仍然需要设置它,而不是选择dir 每次选择变量时。