Cannot run program \"cd\": error=2, No such file or directory

来源:互联网 发布:控制电脑使用时间软件 编辑:程序博客网 时间:2024/06/14 18:47

Cannot run program\"cd\": error=2, No such file or directory

这个错误是在使用Runtime.exec(command)时出现的,后来查找网络资源后解决。

出现这个问题的原因应该和command中的特殊字符有关(可能是windows字符)

解决方法:Runtime.exec(new String[] {"/bin/sh", "-c", command})

0 0
原创粉丝点击