O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

There is more...

You can provide an erroneous command to ProcessBuilder and then see the error get written to the error file and nothing in the output file. You could do this by changing the ProcessBuilder instance creation as follows:

ProcessBuilder pb = new ProcessBuilder("iostat", "-Z");

Compile and run by using the commands given earlier in the How to do it... section.

You will see that there is an error reported in the error file but nothing in the output file:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required