Java exec executeCommand2(boolean isProcessBuilder, String command)

Here you can find the source of executeCommand2(boolean isProcessBuilder, String command)

Description

execute Command

License

Apache License

Declaration

public static String executeCommand2(boolean isProcessBuilder, String command) throws IOException 

Method Source Code

//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;
    }
}

Related

  1. executeCommand(String command)
  2. executeCommand(String command)
  3. executeCommand(String command, boolean waitForResponse)
  4. executeCommand(String[] command, boolean wait)
  5. executeCommand1(boolean isProcessBuilder, String command)
  6. executeCommandAndExtractStdOut(String cmd)
  7. executeCommandForceDir(String baseCommand, String osPath, File file)
  8. executeCommandLine(String command)
  9. executeCommandLineReturnAll( final String[] command)