Java 9: Module java.xml.bind is not accessible in Eclipse

后端 未结 1 1735
花落未央
花落未央 2020-11-30 10:30

I migrating a maven project in Java 8 to a Java 9 project without any build tool in Eclipse OxyGen 1a.

So my m

相关标签:
1条回答
  • 2020-11-30 10:54

    When compiling an unnamed module, java.xml.bind is not accessible by default, but in a modular project (as in this question) failing to resolve reference to module java.xml.bind was a bug (see edit below).

    To work around this until the bug is fixed, you can explicitly include module java.xml.bind by double click on Is modular (see screenshot in the question), and in the dialog that shows, move the desired module from Available modules to Explicitly included modules:

    Edit: Bug 526054 has been resolved in Eclipse Oxygen.2, and thus a modular project should no longer need the steps above (which are still relevant for code in an unnamed module, though).

    Edit 2: In Eclipse 2019-06 the UI for tasks like above has been revamped. Up-to-date documentation can be found in the online help.

    0 讨论(0)
提交回复
热议问题