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
你是在命令行启动还是eclipse?eclipse的话可以试试在命令行下打开eclipseopen /Applications/Eclipse.app
参考:http://www.mkyong.com/java/how-to-execute-shell-command-from-java/
在 Mac 下没有 cmd 这个命令。。。
mac下没有cmd命令的