JDK 9 comes bundled with a new tool called jlink that lets you build your own complete runtime image that contains everything necessary to execute a given application. Remember the new structure of the JDK that we looked at in Chapter 4, Introducing the Modular JDK:
With jlink, you can create a similar custom image of your own to distribute your application. The generated image contains:
- The minimal set of your application and library modules that you've authored or added
- The minimal set of platform modules needed for your application to work
This effectively solves the problem of the huge overhead incurred to ship the platform along with your application. What you ship is just what the application needs--no more, no less. There are further benefits to this process, but before we get into that, let's learn how to use jlink to create this image...