Summary
In this chapter, we looked at what modular Java means. We took advantage of the fact that Java itself has been modularized. This allows you to construct a JRE with jlink
that is significantly smaller than the JDK. You can even make it smaller by only including the modules your code depends on.
We then looked at two ways to distribute your code. The first employed jpackage
to create an installer for your application. The installer can include your custom JRE and will install your program, along with an executable file to run the application. This is usually the best way to distribute desktop applications.
The second distribution method uses the Docker container system. Docker allows us to construct and publish an image that includes not only our code and a JDK but also any other programs required. In our example, the extra program was an application server to which the finance application was installed. The images we construct are published to a repository, such as Docker...