# Java SE 9 - JPMS automatic modules

DevFeed: [Java SE 9 - JPMS automatic modules](<https://devfeed.tech/articles/java-se-9-jpms-automatic-modules-21997.md>)

Original publisher: [Read original article](<http://blog.joda.org/2017/05/java-se-9-jpms-automatic-modules.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2017-05-09T07:14:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [modules](<https://devfeed.tech/topics/modules.md>), [migration](<https://devfeed.tech/topics/migration.md>)

Tags: [java](<https://devfeed.tech/tags/java.md>), [java9](<https://devfeed.tech/tags/java9.md>), [migration](<https://devfeed.tech/tags/migration.md>), [modules](<https://devfeed.tech/tags/modules.md>), [opinion](<https://devfeed.tech/tags/opinion.md>)

## AI overview

This article explains automatic modules in Java SE 9's Java Platform Module System (JPMS), including how they support migration from classpath-based applications when dependencies have not yet been converted to modules. It describes modulepath behavior, automatic-module defaults, and the author's view that this design is problematic.

## Source excerpt

This article in my series on the Java Platform Module System (JPMS) is focussed on automatic modules. JPMS was previously known as Project Jigsaw and is the module system in Java SE 9. See also Module basics, Module naming and Modules & Artifacts. Automatic modules Lets say you are in charge of Java, and after 20 years you want to add a module system to the platform. As well as the problems of designing the module system itself, you have to consider migration of all the existing code written in Java (and to a degree, other JVM languages). The solution to this that JPMS has chosen is automatic modules. Unfortunately, my opinion is that it is the wrong solution. To understand automatic modules, we have to start by looking at how jar files will be specified in future. In addition to the classpath, Java SE 9 will also have a modulepath. The basic idea is that modules (jar files containing module-info.class) will be placed on the modulepath, not the classpath. In fact, placing a module on the classpath will cause the module declaration (module-info.class) to be completely ignored, which is usually not what you want. As a basic rule, the modulepath cannot see the classpath. If you create a module and put it on the modulepath, all its dependencies must also be on the modulepath. Thus, in order to write a module at all, all the dependencies must also have been converted to be modules. And many of those dependencies are likely to be open source projects, with varying release schedules. Clearly, this is a bit of a problem. Essentially, it would mean that an application would need to wait until every dependency had become a module before it could add module-info.java. The "solution" to this is automatic modules. An automatic module is a normal jar file - one without a module-info.class file - that is placed on the modulepath. Thus the modulepath will contain two types of module - "real" and "automatic". Since there is no module-info.class, an automatic module is missing the me