使用Runtime.getRuntime().exec()方法时要注意Working Directory

使用Runtime.getRuntime().exec()方法时要注意Working Directory

如果不设定Working Directory,被调用shell进程的工作目录就是调用进程的工作目录


设定方法是:使用以下方法调用
Runtime.getRuntime().exec(command, envp, dir), dir就是工作目录   

你可能感兴趣的:(工作,shell,command)