question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JDK9: define a stable automatic module name with `Automatic-Module-Name` entry in MANIFEST

See original GitHub issue

JDK9 is out and introduces a module system.

RxJava does not currently use modules. When we use it in a JDK9 modular application, Java turns the JAR into a so-called automatic module, whose name is derived from the JAR archive name. However, the default name does not follow the recommended module naming conventions (reverse-dns style, module name derived from the main exported package).

It is possible to specify a stable automatic module name through a Automatic-Module-Name manifest entry, while still targeting JDK8:

Automatic-Module-Name: io.reactivex

Selecting a stable module name is very important, because Java does not allow two modules to own the same package, and you may end up with a module hell. The naming issues are well-explained on Stephen Colebourne’s blog:

And the comment of Mike Reinhold, chief Java architect:

Strongly recommend that all modules be named according to the reverse Internet domain-name convention. A module’s name should correspond to the name of its principal exported API package, which should also follow that convention. If a module does not have such a package, or if for legacy reasons it must have a name that does not correspond to one of its exported packages, then its name should at least start with the reversed form of an Internet domain with which the author is associated.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
JakeWhartoncommented, Sep 24, 2017

io.reactivex.rxjava2 would be better.

On Sun, Sep 24, 2017, 11:14 AM Tomasz Jędrzejewski notifications@github.com wrote:

JDK9 is out and introduces a module system.

RxJava does not currently use modules. When we use it in a JDK9 modular application, Java turns the JAR into a so-called automatic module, whose name is derived from the JAR archive name. However, the default name does not follow the recommended module naming conventions (reverse-dns style, module name derived from the main exported package).

It is possible to specify a stable automatic module name through a Automatic-Module-Name manifest entry, while still targeting JDK8:

Automatic-Module-Name: io.reactivex

Selecting a stable module name is very important, because Java does not allow two modules to own the same package, and you may end up with a module hell. The naming issues are well-explained on Stephen Colebourne’s blog:

And the comment of Mike Reinhold, chief Java architect:

Strongly recommend that all modules be named according to the reverse Internet domain-name convention. A module’s name should correspond to the name of its principal exported API package, which should also follow that convention. If a module does not have such a package, or if for legacy reasons it must have a name that does not correspond to one of its exported packages, then its name should at least start with the reversed form of an Internet domain with which the author is associated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ReactiveX/RxJava/issues/5618, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEQv68UhFi-hX8Vt_XfaYZE8M4YADks5slnHCgaJpZM4Ph64L .

0reactions
akarnokdcommented, Oct 4, 2017

Closing via #5644.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic-Module-Name: Calling all Java Library Maintainers
This first step boils down to picking a module name, and adding it as Automatic-Module-Name: <module name> entry to the library's MANIFEST.
Read more >
java - What is an automatic module? - Stack Overflow
I first answer your actual question ("What is an automatic module? ... has the attribute Automatic-Module-Name in its main manifest entry.
Read more >
Here's a cool Java 9 feature — Automatic-Module-Name
A ModuleFinder can only find one module with a given name. ... in its top-level directory defines an automatic module, as follows:.
Read more >
eclipse.jdt.core.git - Eclipse JDT Core - Eclipse Git repositories
- // The name includes the file's extension, but it shouldn't matter. - module = new AutoModule(getFileName(file).toCharArray());. + if (isModulepath ...
Read more >
Add automatic module name entry to MANIFEST.MF in java jar
In Java 9+, jars are supposed to have module names. If they don't (e.g., a jar built from an earlier version of Java),...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found