In my Java application, I want to run a batch file that calls "scons -Q implicit-deps-changed build\file_load_type export\file_load_type
"
It seems that I can't even get my batch file to execute. I'm out of ideas.
This is what I have in Java:
Runtime.
getRuntime().
exec("build.bat", null, new File("."));
Previously, I had a Python Sconscript file that I wanted to run but since that didn't work I decided I would call the script via a batch file but that method has not been successful as of yet.
tested with jdk1.5 and jdk1.6
This was working fine for me, hope it helps others too. to get this i have struggled more days. :(
Sometimes the thread execution process time is higher than JVM thread waiting process time, it use to happen when the process you're invoking takes some time to be processed, use the waitFor() command as follows:
This way the JVM will stop until the process you're invoking is done before it continue with the thread execution stack.
To run batch files using java if that's you're talking about...
This should do it.
ProcessBuilder is the Java 5/6 way to run external processes.
The following is working fine: