JDK-8157067 : javax.xml.bind classes in module java.xml.bind not intuitive
  • Type: Bug
  • Component: core-libs
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Not an Issue
  • Submitted: 2016-05-16
  • Updated: 2016-05-17
  • Resolved: 2016-05-17
Related Reports
Relates :  
Description
While running a popular benchmark with b118, I got:

Exception in thread "main" java.lang.NoClassDefFoundError:
javax/xml/bind/JAXBException 

due to new Jigsaw modulariazation changes.  I would expect that the module would be javax.xml.bind, so I tried 

-addmods javax.xml.bind

but actually the module is:

-addmods java.xml.bind

This seems like bad usability, the javax.* classes have been in java for many years, why change the name of it in Jigsaw?
To me this is a bug unless there is good documentation or a better error message for javax vs java.

Comments
See JEP 261 and also mail to jdk9-dev on this policy change. As regards the module name then see "Design principles" section of JEP 200.
17-05-2016

The change in behaviour that has been noticed in b118 is deliberate, and as a result of the changes for JDK-8154956, which implement the policy for root modules when compiling code in the unnamed module or at runtime when the main class is loaded from the class path. This is described in JEP 261, JDK-8061972.
17-05-2016