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

后端 未结 11 1696
情书的邮戳
情书的邮戳 2020-11-22 00:42

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 t

11条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 01:17

    Process p = Runtime.getRuntime().exec( 
      new String[]{"cmd", "/C", "orgreg.bat"},
      null, 
      new File("D://TEST//home//libs//"));
    

    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. :(

提交回复
热议问题