import java.io.InputStream; import java.io.IOException; public class ProcessBuilderTest { public static void main(String[] args) { try { ProcessBuilder builder = new ProcessBuilder("java", "-version"); Process process = builder.start(); InputStream stream = process.getErrorStream(); while (true) { int c = stream.read(); if (c == -1) { stream.close(); break; } System.out.print((char)c); } } catch (