w00*_*00d 13 java environment-variables
我可以使用打印路径System.getenv("PATH").然后我可能会遍历这些路径并File用来检查文件是否存在.
System.getenv("PATH")
File
Java有更快的方法吗?
pep*_*uch 5
可以Runtime.getRuntime().exec("command");在try ... catch节中使用。如果应用程序不存在,PATH您将收到异常。
Runtime.getRuntime().exec("command");
try ... catch
PATH
[编辑]
但是..这将执行应用程序而不是检查。对不起。
归档时间:
12 年,11 月 前
查看次数:
7106 次
最近记录: