© Kishori Sharan 2017

Kishori Sharan, Java 9 Revealed, 10.1007/978-1-4842-2592-9_9

9. Breaking Module Encapsulation

Kishori Sharan

(1)Montgomery, Alabama, USA

In this chapter, you will learn:

  • What breaking a module’s encapsulation is

  • How to add dependency (add requires) to a module using the command-line option

  • How to export non-exported packages of a module using the --add-exports command-line option and using the MANIFEST.MF file of an executable JAR

  • How to open non-open packages of a module using the --add-opens command-line option and using the MANIFEST.MF file of an executable JAR

  • How to increase readability of a module using the --add-reads command-line option

What Is Breaking Module Encapsulation?

One of the main goals of JDK 9 is to encapsulate ...

Get Java 9 Revealed: For Early Adoption and Migration now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.