Skip to content

Instantly share code, notes, and snippets.

@bjpeterdelacruz
Created February 17, 2014 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjpeterdelacruz/9046202 to your computer and use it in GitHub Desktop.
Save bjpeterdelacruz/9046202 to your computer and use it in GitHub Desktop.
ProcessBuilder builder = new ProcessBuilder("java", "-classpath", classpath, "com.a.b.c.TestProgram", "hello", "world");
// java -classpath [classpath] com.a.b.c.TestProgram hello world
Process process = builder.start();
// Process is now running.
// Block until the process terminates, and then get its exit value.
int exitValue = process.waitFor();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment