标签:rgs process exec 链接 tar buffered detail 通过 color
package test; import java.io.BufferedReader; import java.io.File; import java.io.InputStreamReader; public class TestDatax { public static void main(String[] args) { try { System.out.println("start"); String windowcmd = "cmd /c python2 datax.py F:\\json.json"; //.exec("你的命令",null,new File("datax安装路径")); Process pr = Runtime.getRuntime().exec(windowcmd,null,new File("D:\\DataX\\datax\\bin")); BufferedReader in = new BufferedReader(new InputStreamReader(pr.getInputStream())); String line = null; while ((line = in.readLine()) != null) { System.out.println(line); } in.close(); pr.waitFor(); System.out.println("end"); } catch (Exception e) { e.printStackTrace(); } } }
标签:rgs process exec 链接 tar buffered detail 通过 color
原文地址:https://www.cnblogs.com/zlj843767688/p/12393123.html