I am just starting out here in SO, so couldn't upvote @Franci Penov's answer as correct:
rt.exec(new String[]{"cmd.exe","/C","build.bat"});
or simply,
rt.exec("cmd.exe /C build.bat");
should not bring up a command prompt. build.bat will be executed headlessly.
Suppose you do want to bring up a command prompt while build.bat is running (so you can see the output right from the command prompt instead of processing it later), and want the command prompt to go away after build.bat has finished execution, you may use the following:
rt.exec("cmd.exe /C start cmd.exe /C batch.bat");
the start starts a (visible) command prompt window to process and display the output of cmd.exe /C batch.bat. If you have a pause at the end of your batch.bat then all you need to do is hitting a key, and the command prompt will go away without the need to type exit at the prompt window to close it.
This may not be what you need, but I have been searching on SO but then found out the solution myself. Just to share it.