clojure-java-9 icon indicating copy to clipboard operation
clojure-java-9 copied to clipboard

ClassNotFoundException: javax.xml.bind.*

Open stuartsierra opened this issue 7 years ago • 1 comments

The java.xml.bind package is deprecated in Java 9 and not included in the default classpath. Code which tries to use classes under java.xml.bind.* will throw ClassNotFoundException. For example, from clavatar:

java.lang.ClassNotFoundException: javax.xml.bind.annotation.adapters.HexBinaryAdapter

The fix, as described in How to upgrade your Clojure projects to use Java 9, is to add the JVM option --add-modules "java.xml.bind". In a Leiningen project.clj file, this is:

:jvm-opts ["--add-modules" "java.xml.bind"]

Libraries affected by this:

stuartsierra avatar Mar 10 '18 20:03 stuartsierra

ClojureScript used to import that package, fixed as of https://github.com/clojure/clojurescript/commit/544c1b77d76d48f234cdb03746ea993158c46aff

ghadishayban avatar Mar 19 '18 15:03 ghadishayban