So, I took the SOAP example in the Soap working client example , put it in the SOAPClientSAAJ.java file and tried to compile it (Openjdk 9 on Debian):
t@h ~/javatest> javac SOAPClientSAAJ.java SOAPClientSAAJ.java:1: error: package javax.xml.soap is not visible import javax.xml.soap.*; ^ (package javax.xml.soap is declared in module java.xml.ws, which is not in the module graph) 1 error
After some of them appeared on Google, I found out that compilation and launch are performed as
t@h ~/javatest> javac --add-modules java.xml.ws SOAPClientSAAJ.java t@h ~/javatest> java --add-modules java.xml.ws SOAPClientSAAJ
works. See also this video for the general background: https://www.youtube.com/watch?v=y8bpKYDrF5I&t=20m17s
Now the questions are:
- Should the compiler automatically add the java.xml.ws module? (since he obviously knows that this is necessary) Is this a bug in javax.xml.soap?
- Why is the -add-modules option not documented in my manual pages? (openjdk 9 on Debian)
- What should be written in the .java file to automatically add the java.xml.ws module?
source share