How do I run a batch file from my Java Application?

Runtime.getRuntime().exec("cmd /c start build.bat");

 

this is the best way to run the batch file.

Runtime runtime = Runtime.getRuntime();

try {

    Process p1 = runtime.exec("cmd /c start D:\	emp\\a.bat");

    InputStream is = p1.getInputStream();

    int i = 0;

    while( (i = is.read() ) != -1) {

        System.out.print((char)i);

    }

} catch(IOException ioException) {

    System.out.println(ioException.getMessage() );

}