Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.2 KB

README.md

File metadata and controls

36 lines (28 loc) · 1.2 KB

Simple Java Run Cmd

GitHub Workflow Status (with branch) Available on maven central license

Simple java library to spawn system processes. Expect to run command line tools and get some degree of control over input and output.

Sample usage

public class Example {
    public static void main(String ...args) {
        SyncRunCmd cmd = new SyncRunCmd("echo", "hello world").exec();
        System.out.println(cmd.getOutResult()); // prints hello world
    }    
}

Goals

  • Spawn a process
  • Get results
  • Never hang up (watchdog)
  • Pass arguments
  • Pass 'interactive' input
  • Run on another thread
  • Get PID
  • Observe process (out, error, exception, time)
  • Proper logging

Caveats

  • This library intentionally treats inputs and outputs as text. Do not pipe binary data to it, or it will break.