I am using windows 7 and program in Netbeans platform. I have wrote this line:
Runtime.getRuntime().exec("cmd /c start make.bat");
When I run the bat it works perfectly, but then java calls it this is what I get:
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.
The contents of the bath file is:
dot -T png -o tree.png tree.dot
Try to specify full path to ‘dot’ program in your bat file. It is possible thet environment variables like PATH are not the same in Runtime.getRuntime().exec() and your OS.