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

Introduction

How often have you ended up writing code that spawns a new process? Not often. However, there would be situations that ask for writing such code. In such cases, you resort to using a third-party API such as Apache Commons Exec (https://commons.apache.org/proper/commons-exec/) and the like. Why was this? Wasn't the Java API sufficient? No, it wasn't, at least until Java 9. Now with Java 9, we have quite a few more features added to the process API. 

Until Java 7, redirecting the input, output, and error streams was not trivial. With Java 7, there were new APIs introduced, which allowed the redirecting of the input, output, and error to other processes (pipe), to a file, or to a standard input/output. Then in Java 8, there were ...

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