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

or

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

References:

Java 9 release note

Was this post helpful?
Let us know, if you liked the post. Only in this way, we can improve us.
Yes
No
Tags:

Leave a Reply

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