JPMS.ARGS

Java 9 comes with a new set of arguments related to the Java Platform Modular System. Besides the module path are other new arguments which can change the behavior of the application. These can be used during both compile time and runtime. This information is not stored in any class, but it can be interesting to know at runtime which extra arguments were used at compile time.

If any of these arguments is used, the META-INF/jpms.args is created. Every argument gets its own line. The following arguments will end up in this file:

  • --upgrade-module-path
  • --add-exports
  • --add-reads
  • --add-modules
  • --limit-modules
  • --patch-module

The --patch-module values are different compared to the original values passed to the compiler. According to the specification it looks like --patch-module <module>=<file>(<pathsep><file>)* However, files are system specific. For that reason the module names are used. If the jar itself contains the patchcode, then an _ (underscore) is used. As separators a , (comma + space) is used.

  --patch-module
  <module>=<module>(, <module>)*