Runtime rt = Runtime.getRuntime();
Process process = rt.exec(“mysql -uroot -p”);
报错,java.io.IOException: Cannot run program "cmd": error=2, No such file or directory
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
在 Mac 下没有 cmd 这个命令。。。
mac下没有cmd命令的
你是在命令行启动还是eclipse?eclipse的话可以试试在命令行下打开eclipse
open /Applications/Eclipse.app参考:http://www.mkyong.com/java/how-to-execute-shell-command-from-java/