我在 Netbeans 平台上使用 Windows 7 和程序。我写了这一行:
Runtime.getRuntime().exec("cmd /c start make.bat");
当我运行 bat 时,它运行良好,但是 java 调用它,这就是我得到的:
C:\Users\RB\Documents\NetBeansProjects\BinaryTree>dot -T png -o tree.png tree.dot 'dot' is not recognized as an internal or external command, operable program or batch file. C:\Users\RB\Documents\NetBeansProjects\BinaryTree>cmd Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.
浴文件的内容是:
dot -T png -o tree.png tree.dot