Here you can find the source of executeCommand2(boolean isProcessBuilder, String command)
public static String executeCommand2(boolean isProcessBuilder, String command) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { public static String executeCommand2(boolean isProcessBuilder, String command) throws IOException { // ProcessBuilder dirProcess = new ProcessBuilder("cmd"); // File commands = new File("C:/process/commands.bat"); // File dirOut = new File("C:/process/out.txt"); // File dirErr = new File("C:/process/err.txt"); ProcessBuilder dirProcess = new ProcessBuilder("java", "-Xmx1024m", "-Xms1024m", "-DTOOLS_DIR=/home/IM/work/dist", "-Daoi=whole", "-jar", "/home/IM/work/dist/idt_tools.jar"); File commands = new File("C:/process/commands.bat"); File dirOut = new File("C:/process/out.txt"); File dirErr = new File("C:/process/err.txt"); dirProcess.start();//from w w w . j a v a 2s .co m return null; } }