“package javax.xml.soap is declared in module java.xml.ws, which is not in the module graph”

前端 未结 1 980
无人共我
无人共我 2020-12-10 14:02

So I took the SOAP example at Working Soap client example , put it into a file SOAPClientSAAJ.java, and tried compiling it (Openjdk 9 on Debian):



        
相关标签:
1条回答
  • 2020-12-10 14:40

    This is a result of the new Java 9 modules. The javax.xml.soap package is actually a Java EE package, and so now isn't visible. The current workaround is to either use the --add-modules, as you've done, or to modularize your code.

    Modularizing your code requires restructuring it into modules, and including a module-info.java file that specifies the modules you're using. In your case, specifying java.se.ee would give access to all the EE modules.

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