While working with java 9 this exception may generate exception java.lang.NoClassDefFoundError: javax/xml/bind/ValidationException which indicate that javax/xml/bind/ValidationException class is not accessible. java.base does not contains java.xml.bind module by default.

--add-modules option is used to add module dependency.

Use following command you can add module:

java --add-modules java.xml.bind -jar demo.jar


java --add-modules java.se.ee -jar demo.jar


Java 9 release note

Was this post helpful?


Leave a Reply

Your email address will not be published. Required fields are marked *