eclipse 在Eclipse中设置执行目录?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/329129/
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
Set the execution directory in Eclipse?
提问by Burkhard
Is it possible, to execute a class in a specified directory?
是否可以在指定目录中执行类?
I mean, a.class is in directory abc and i want it to be executed as if it were in directory xyz.
我的意思是,a.class 在目录 abc 中,我希望它像在目录 xyz 中一样执行。
回答by Jon Skeet
Absolutely.
绝对地。
Go into the Debug/Run dialog (drop down button next to the bug/"go" buttons), and in the Arguments tab, set the Working Directory by selecting "Other" and then putting in the relevant directory name. Note that the directory can use "variables" like $workspace_loc
. You can even make it prompt the user using $folder_prompt
.
进入 Debug/Run 对话框(bug/“go”按钮旁边的下拉按钮),然后在 Arguments 选项卡中,通过选择“Other”然后输入相关目录名称来设置工作目录。请注意,该目录可以使用“变量”,例如$workspace_loc
. 您甚至可以使用$folder_prompt
.