bhauman / lein-figwheel

Figwheel builds your ClojureScript code and hot loads it into the browser as you are coding!
Eclipse Public License 1.0
2.88k stars 210 forks source link

ClassNotFoundException with lein figwheel and Java 9 #612

Open n2o opened 7 years ago

n2o commented 7 years ago

Hey,

I am getting a ClassNotFoundException after I installed Java 9 on my machine. That's the setup:

$ java -version 
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

I am using leiningen and commented out line 218 in lein to avoid another Exception (as suggested here):

$ lein version
Leiningen 2.7.1 on Java 9 Java HotSpot(TM) 64-Bit Server VM

I also tried the latest snapshot of leiningen, which throws the same exception:

$ lein-dev version
Leiningen 2.8.0-SNAPSHOT on Java 9 Java HotSpot(TM) 64-Bit Server VM

When you then create a new figwheel-project and try to start it, it throws with both leiningen installations the same error:

$ lein new figwheel foo
$ cd foo
$ lein figwheel
Figwheel: Cutting some fruit, just a sec ...
Exception in thread "main" java.lang.ExceptionInInitializerError
    at clojure.main.<clinit>(main.java:20)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(cljs/util.cljc:1:1)
    at clojure.lang.Compiler.load(Compiler.java:7469)
    at clojure.lang.RT.loadResourceScript(RT.java:374)
    at clojure.lang.RT.loadResourceScript(RT.java:365)
    at clojure.lang.RT.load(RT.java:455)
    at clojure.lang.RT.load(RT.java:421)
    at clojure.core$load$fn__6368.invoke(core.clj:6008)
    at clojure.core$load.invokeStatic(core.clj:6007)
    at clojure.core$load.doInvoke(core.clj:5991)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5812)
    at clojure.core$load_one.invoke(core.clj:5807)
    at clojure.core$load_lib$fn__6313.invoke(core.clj:5852)
    at clojure.core$load_lib.invokeStatic(core.clj:5851)
    at clojure.core$load_lib.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$load_libs.invokeStatic(core.clj:5889)
    at clojure.core$load_libs.doInvoke(core.clj:5873)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$require.invokeStatic(core.clj:5911)
    at clojure.core$require.doInvoke(core.clj:5911)
    at clojure.lang.RestFn.invoke(RestFn.java:805)
    at cljs.analyzer$eval357$loading__6254__auto____358.invoke(analyzer.cljc:9)
    at cljs.analyzer$eval357.invokeStatic(analyzer.cljc:9)
    at cljs.analyzer$eval357.invoke(analyzer.cljc:9)
    at clojure.lang.Compiler.eval(Compiler.java:7005)
    at clojure.lang.Compiler.eval(Compiler.java:6994)
    at clojure.lang.Compiler.load(Compiler.java:7457)
    at clojure.lang.RT.loadResourceScript(RT.java:374)
    at clojure.lang.RT.loadResourceScript(RT.java:365)
    at clojure.lang.RT.load(RT.java:455)
    at clojure.lang.RT.load(RT.java:421)
    at clojure.core$load$fn__6368.invoke(core.clj:6008)
    at clojure.core$load.invokeStatic(core.clj:6007)
    at clojure.core$load.doInvoke(core.clj:5991)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5812)
    at clojure.core$load_one.invoke(core.clj:5807)
    at clojure.core$load_lib$fn__6313.invoke(core.clj:5852)
    at clojure.core$load_lib.invokeStatic(core.clj:5851)
    at clojure.core$load_lib.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$load_libs.invokeStatic(core.clj:5889)
    at clojure.core$load_libs.doInvoke(core.clj:5873)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$require.invokeStatic(core.clj:5911)
    at clojure.core$require.doInvoke(core.clj:5911)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at figwheel_sidecar.utils$eval351$loading__6254__auto____352.invoke(utils.clj:1)
    at figwheel_sidecar.utils$eval351.invokeStatic(utils.clj:1)
    at figwheel_sidecar.utils$eval351.invoke(utils.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:7005)
    at clojure.lang.Compiler.eval(Compiler.java:6994)
    at clojure.lang.Compiler.load(Compiler.java:7457)
    at clojure.lang.RT.loadResourceScript(RT.java:374)
    at clojure.lang.RT.loadResourceScript(RT.java:365)
    at clojure.lang.RT.load(RT.java:455)
    at clojure.lang.RT.load(RT.java:421)
    at clojure.core$load$fn__6368.invoke(core.clj:6008)
    at clojure.core$load.invokeStatic(core.clj:6007)
    at clojure.core$load.doInvoke(core.clj:5991)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5812)
    at clojure.core$load_one.invoke(core.clj:5807)
    at clojure.core$load_lib$fn__6313.invoke(core.clj:5852)
    at clojure.core$load_lib.invokeStatic(core.clj:5851)
    at clojure.core$load_lib.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$load_libs.invokeStatic(core.clj:5889)
    at clojure.core$load_libs.doInvoke(core.clj:5873)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$require.invokeStatic(core.clj:5911)
    at clojure.core$require.doInvoke(core.clj:5911)
    at clojure.lang.RestFn.invoke(RestFn.java:1523)
    at figwheel_sidecar.config$eval153$loading__6254__auto____154.invoke(config.clj:1)
    at figwheel_sidecar.config$eval153.invokeStatic(config.clj:1)
    at figwheel_sidecar.config$eval153.invoke(config.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:7005)
    at clojure.lang.Compiler.eval(Compiler.java:6994)
    at clojure.lang.Compiler.load(Compiler.java:7457)
    at clojure.lang.RT.loadResourceScript(RT.java:374)
    at clojure.lang.RT.loadResourceScript(RT.java:365)
    at clojure.lang.RT.load(RT.java:455)
    at clojure.lang.RT.load(RT.java:421)
    at clojure.core$load$fn__6368.invoke(core.clj:6008)
    at clojure.core$load.invokeStatic(core.clj:6007)
    at clojure.core$load.doInvoke(core.clj:5991)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5812)
    at clojure.core$load_one.invoke(core.clj:5807)
    at clojure.core$load_lib$fn__6313.invoke(core.clj:5852)
    at clojure.core$load_lib.invokeStatic(core.clj:5851)
    at clojure.core$load_lib.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$load_libs.invokeStatic(core.clj:5889)
    at clojure.core$load_libs.doInvoke(core.clj:5873)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$require.invokeStatic(core.clj:5911)
    at clojure.core$require.doInvoke(core.clj:5911)
    at clojure.lang.RestFn.invoke(RestFn.java:436)
    at figwheel_sidecar.build_utils$eval147$loading__6254__auto____148.invoke(build_utils.clj:1)
    at figwheel_sidecar.build_utils$eval147.invokeStatic(build_utils.clj:1)
    at figwheel_sidecar.build_utils$eval147.invoke(build_utils.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:7005)
    at clojure.lang.Compiler.eval(Compiler.java:6994)
    at clojure.lang.Compiler.load(Compiler.java:7457)
    at clojure.lang.RT.loadResourceScript(RT.java:374)
    at clojure.lang.RT.loadResourceScript(RT.java:365)
    at clojure.lang.RT.load(RT.java:455)
    at clojure.lang.RT.load(RT.java:421)
    at clojure.core$load$fn__6368.invoke(core.clj:6008)
    at clojure.core$load.invokeStatic(core.clj:6007)
    at clojure.core$load.doInvoke(core.clj:5991)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5812)
    at clojure.core$load_one.invoke(core.clj:5807)
    at clojure.core$load_lib$fn__6313.invoke(core.clj:5852)
    at clojure.core$load_lib.invokeStatic(core.clj:5851)
    at clojure.core$load_lib.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$load_libs.invokeStatic(core.clj:5889)
    at clojure.core$load_libs.doInvoke(core.clj:5873)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$require.invokeStatic(core.clj:5911)
    at clojure.core$require.doInvoke(core.clj:5911)
    at clojure.lang.RestFn.invoke(RestFn.java:930)
    at figwheel_sidecar.repl_api$eval141$loading__6254__auto____142.invoke(repl_api.clj:1)
    at figwheel_sidecar.repl_api$eval141.invokeStatic(repl_api.clj:1)
    at figwheel_sidecar.repl_api$eval141.invoke(repl_api.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:7005)
    at clojure.lang.Compiler.eval(Compiler.java:6994)
    at clojure.lang.Compiler.load(Compiler.java:7457)
    at clojure.lang.RT.loadResourceScript(RT.java:374)
    at clojure.lang.RT.loadResourceScript(RT.java:365)
    at clojure.lang.RT.load(RT.java:455)
    at clojure.lang.RT.load(RT.java:421)
    at clojure.core$load$fn__6368.invoke(core.clj:6008)
    at clojure.core$load.invokeStatic(core.clj:6007)
    at clojure.core$load.doInvoke(core.clj:5991)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5812)
    at clojure.core$load_one.invoke(core.clj:5807)
    at clojure.core$load_lib$fn__6313.invoke(core.clj:5852)
    at clojure.core$load_lib.invokeStatic(core.clj:5851)
    at clojure.core$load_lib.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$load_libs.invokeStatic(core.clj:5889)
    at clojure.core$load_libs.doInvoke(core.clj:5873)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$require.invokeStatic(core.clj:5911)
    at clojure.core$require.doInvoke(core.clj:5911)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at user$eval135$loading__6254__auto____136.invoke(user.clj:1)
    at user$eval135.invokeStatic(user.clj:1)
    at user$eval135.invoke(user.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:7005)
    at clojure.lang.Compiler.eval(Compiler.java:6994)
    at clojure.lang.Compiler.load(Compiler.java:7457)
    at clojure.lang.RT.loadResourceScript(RT.java:374)
    at clojure.lang.RT.loadResourceScript(RT.java:361)
    at clojure.lang.RT.maybeLoadResourceScript(RT.java:357)
    at clojure.lang.RT.doInit(RT.java:479)
    at clojure.lang.RT.<clinit>(RT.java:333)
    ... 1 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
    at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
    at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:375)
    at clojure.lang.RT.classForName(RT.java:2183)
    at clojure.lang.RT.classForNameNonLoading(RT.java:2196)
    at cljs.util$eval363$loading__6254__auto____364.invoke(util.cljc:9)
    at cljs.util$eval363.invokeStatic(util.cljc:9)
    at cljs.util$eval363.invoke(util.cljc:9)
    at clojure.lang.Compiler.eval(Compiler.java:7005)
    at clojure.lang.Compiler.eval(Compiler.java:6994)
    at clojure.lang.Compiler.load(Compiler.java:7457)
    ... 174 more
Subprocess failed

Thanks for your help!

rbialon commented 7 years ago

The module javax.xml.bind has been renamed and is also deprecated as of Java 9, so it might be a good idea to migrate to another implementation for the future.

A workaround would be adding --add-modules java.xml.bind to the javac compilation and java call as suggested here.

Kingpatzer commented 6 years ago

I'm just starting with Clojure and Java so -- can someone tell me how to work around this? what do I need to add to the standard "lein new figwheel " template to be able to not blow up?

I'm on a mac.

I've downloaded javax.xlm from mvnrepository (version 2.3).

I've added :javac-options ["--add-modules java.xml.bind" to my project.clj

I'm still getting the error mentioned above.

java 9.0.1 Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

Leiningen 2.8.1 on Java 9.0.1 Java HotSpot(TM) 64-Bit Server VM

derekchiang commented 6 years ago

Looks like you need to add the flag to :jvm-opts in project.clj, like this:

  :jvm-opts ["--add-modules" "java.xml.bind"]
n2o commented 6 years ago

I switched back to JDK 8 for now to continue developing in clojurescript.

bhauman commented 6 years ago

OK I fixed this in the figwheel template. So that if someone is generating a project from Java 9

It adds

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

To the project.clj

https://github.com/bhauman/figwheel-template/commit/627fa1d95d19682ebcc39627c2785eaa70482e22

I'm leaving this open so that people find it.

empperi commented 6 years ago

I would like to point out, that by adding :jvm-opts ["--add-modules" "java.xml.bind"] you are breaking Java 8 support since flag --add-modules is only recognized by Java 9. The only real solution for this is to migrate away from java.xml.bind or to wait that Clojure adds support for Java modules so that Figwheel could declare the module dependency correctly (meaning, generate module-info.java within jar).

empperi commented 6 years ago

Here is a slightly less hacky hack (pun intended) to bypass this problem:

  :jvm-opts ~(concat
               ; Normal JVM opts to pass in
               ["-Xmx1g"]
               ; Java 9+ recognition, adding --add-modules. Java versions before 9
               ; had a different version syntax where they contained '.' delimiters,
               ; from Java 9 onwards it has a simple versioning scheme based on one
               ; number.
               (if (false? (.contains (System/getProperty "java.version") "."))
                 ["--add-modules" "java.xml.bind"]
                 []))

This should work with all existing versions of Java. Not exactly pretty but at least it works as a workaround while we wait for the proper fix.

:edit:

Sigh. As a hack that obviously doesn't work with Cursive. Since Cursive is doing it's own bit of magic on evaluating what is within project.clj it does not support arbitrary code execution via ~ to define project.clj definitions dynamically. Well, Cider/Fireplace guys should be happy with that at least I guess. :P

:edit 2:

Cursive problem is a local one and thus it can be solved locally (meaning, you should know what Java version you are running yourself). Add this to your Run Configuration and it should work with Cursive too:

image

livtanong commented 6 years ago

That's odd, I got a version number 9.0.1. could we do a split on the .s and check if the first element is 9?

edit: What worked for me is:

(let [version (System/getProperty "java.version")
        [major _ _] (clojure.string/split version #"\.")]
  (if (>= (Integer. major) 9)
    ["--add-modules" "java.xml.bind"]
    []))

edit2: coerce string to number as per @empperi 's suggestion

empperi commented 6 years ago

@levitanong Maybe also parse it to number and make comparison that it is equal or greater to 9?

danielcompton commented 6 years ago

This might also be useful https://docs.oracle.com/javase/9/docs/api/java/lang/Runtime.Version.html, though not sure how far back it's available (only 9?).

livtanong commented 6 years ago

@empperi Yes, that would be much better! @danielcompton If it's only 9, wouldn't it throw on <9?

danielcompton commented 6 years ago

@levitanong yeah it would, you could do some fancy loading stuff. Was just throwing it out there as an idea, though maybe not a great one.

puredanger commented 6 years ago

In general, I find it is far preferable to make a decision based on the presence or absence of a class that can be loaded vs the version string (which they are in the process of radically changing for java). For example, check whether you can (Class/forName "javax.xml.bind.DatatypeConverter").

empperi commented 6 years ago

@puredanger I agree but in this case doing that will cause try-catching and whatnot which just adds to the already noisy hack which shouldn't even be in project.clj. Like we all agree I think, the best solution for this is just to fix figwheel (and a whole bunch of other libraries out there) to not use javax.xml.bind stuff. Considering that what most use is javax.xml.bind.DatatypeConverter like you mentioned above and that stuff is mostly for JAXB (which is pretty much useless for Clojure apps) it shouldn't be too big of a problem.

danielcompton commented 6 years ago

@empperi I'm pretty sure the issue is actually with ClojureScript, not Figwheel, I can't see figwheel using DatatypeConverter anywhere. The next version of ClojureScript should fix this. See my post on updating to Java 9 for more details.

tirkarthi commented 6 years ago

Sorry to bump this up but the latest Clojurescript release 1.10 fixes this issue. The figwheel-core at https://github.com/bhauman/lein-figwheel/blob/933e01c69a0bd2d25e47eb3dc6213bf9d24909a2/figwheel-core/project.clj#L11

It has the updated dependency and the other modules have the old dependency. I don't know the places where this needs to be updated but just wanted to add it has been resolved without the need to use jvm-opts and add-modules options.

Relevant JIRA : https://dev.clojure.org/jira/browse/CLJS-2377

bhauman commented 6 years ago

Hey thanks but you don't need to update this in the core tooling projects.

Users need to update the cljs dependency in their own projects.

This forces users to use 1.10 when that is not necessary yet.

On Mar 29, 2018, at 7:50 AM, Xtreak notifications@github.com wrote:

Sorry to bump this up but the latest Clojurescript release 1.10 fixes this issue. The figwheel-core at https://github.com/bhauman/lein-figwheel/blob/933e01c69a0bd2d25e47eb3dc6213bf9d24909a2/figwheel-core/project.clj#L11

It has the updated dependency and the other modules have the old dependency. I don't know the places where this needs to be updated but just wanted to add it has been resolved without the need to use jvm-opts and add-modules options.

Relevant JIRA : https://dev.clojure.org/jira/browse/CLJS-2377

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mfikes commented 6 years ago

Now that ClojureScript 1.10.238 is out, perhaps the template should depend on it. Perhaps a new http-kit dependency should be brought in as well to avoid the same problem.

This would allow users on Java 9 or 10 to do

lein new figwheel myproject

without encountering errors.

bhauman commented 6 years ago

I've just updated figwheel and figwheel-template to address the Java 9 problems https://github.com/bhauman/lein-figwheel/commit/6fb335961311bf172094cc05d392c40bbde66696 https://github.com/bhauman/lein-figwheel/commit/ce8fddcf25a066d4a4753fd7822dbc2a87d14d02#diff-4367e1e3b4d141bc25ecb930cb78b5aaR11 https://github.com/bhauman/figwheel-template/commit/45d1de6e060390857b2bbb2a35c23a0e6bd20a32

jlo1 commented 6 years ago

FYI, seeing same error printed out using JDK 10. Works after downgrading back to JDK 8. Nvm! Mistake on my end. Works fine with JDK 10!

danielcompton commented 6 years ago

@jlo1 are you seeing exactly the same error? Can you print out the full stack trace and share which versions of ClojureScript and Figwheel you have? The error may be coming from another dependency, not Figwheel.

kredati commented 6 years ago

Sadly, like @jlo1 (before he realized his mistake), I'm am getting this error with JDK10. I'm new enough to Clojure and CLJS (and Java), I don't have the Google-fu to troubleshoot this.

Here's the full stack trace:

➜  flappy-bird-demo git:(master) lein figwheel
Figwheel: Cutting some fruit, just a sec ...
Exception in thread "main" java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(cljs/util.cljc:1:1)
    at clojure.lang.Compiler.load(Compiler.java:7391)
    at clojure.lang.RT.loadResourceScript(RT.java:372)
    at clojure.lang.RT.loadResourceScript(RT.java:363)
    at clojure.lang.RT.load(RT.java:453)
    at clojure.lang.RT.load(RT.java:419)
    at clojure.core$load$fn__5677.invoke(core.clj:5893)
    at clojure.core$load.invokeStatic(core.clj:5892)
    at clojure.core$load.doInvoke(core.clj:5876)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5697)
    at clojure.core$load_one.invoke(core.clj:5692)
    at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
    at clojure.core$load_lib.invokeStatic(core.clj:5736)
    at clojure.core$load_lib.doInvoke(core.clj:5717)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$load_libs.invokeStatic(core.clj:5774)
    at clojure.core$load_libs.doInvoke(core.clj:5758)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$require.invokeStatic(core.clj:5796)
    at clojure.core$require.doInvoke(core.clj:5796)
    at clojure.lang.RestFn.invoke(RestFn.java:805)
    at cljs.analyzer$eval2662$loading__5569__auto____2663.invoke(analyzer.cljc:9)
    at cljs.analyzer$eval2662.invokeStatic(analyzer.cljc:9)
    at cljs.analyzer$eval2662.invoke(analyzer.cljc:9)
    at clojure.lang.Compiler.eval(Compiler.java:6927)
    at clojure.lang.Compiler.eval(Compiler.java:6916)
    at clojure.lang.Compiler.load(Compiler.java:7379)
    at clojure.lang.RT.loadResourceScript(RT.java:372)
    at clojure.lang.RT.loadResourceScript(RT.java:363)
    at clojure.lang.RT.load(RT.java:453)
    at clojure.lang.RT.load(RT.java:419)
    at clojure.core$load$fn__5677.invoke(core.clj:5893)
    at clojure.core$load.invokeStatic(core.clj:5892)
    at clojure.core$load.doInvoke(core.clj:5876)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5697)
    at clojure.core$load_one.invoke(core.clj:5692)
    at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
    at clojure.core$load_lib.invokeStatic(core.clj:5736)
    at clojure.core$load_lib.doInvoke(core.clj:5717)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$load_libs.invokeStatic(core.clj:5774)
    at clojure.core$load_libs.doInvoke(core.clj:5758)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$require.invokeStatic(core.clj:5796)
    at clojure.core$require.doInvoke(core.clj:5796)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at figwheel_sidecar.utils$eval2656$loading__5569__auto____2657.invoke(utils.clj:1)
    at figwheel_sidecar.utils$eval2656.invokeStatic(utils.clj:1)
    at figwheel_sidecar.utils$eval2656.invoke(utils.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6927)
    at clojure.lang.Compiler.eval(Compiler.java:6916)
    at clojure.lang.Compiler.load(Compiler.java:7379)
    at clojure.lang.RT.loadResourceScript(RT.java:372)
    at clojure.lang.RT.loadResourceScript(RT.java:363)
    at clojure.lang.RT.load(RT.java:453)
    at clojure.lang.RT.load(RT.java:419)
    at clojure.core$load$fn__5677.invoke(core.clj:5893)
    at clojure.core$load.invokeStatic(core.clj:5892)
    at clojure.core$load.doInvoke(core.clj:5876)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5697)
    at clojure.core$load_one.invoke(core.clj:5692)
    at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
    at clojure.core$load_lib.invokeStatic(core.clj:5736)
    at clojure.core$load_lib.doInvoke(core.clj:5717)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$load_libs.invokeStatic(core.clj:5774)
    at clojure.core$load_libs.doInvoke(core.clj:5758)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$require.invokeStatic(core.clj:5796)
    at clojure.core$require.doInvoke(core.clj:5796)
    at clojure.lang.RestFn.invoke(RestFn.java:1096)
    at figwheel_sidecar.config$eval21$loading__5569__auto____22.invoke(config.clj:1)
    at figwheel_sidecar.config$eval21.invokeStatic(config.clj:1)
    at figwheel_sidecar.config$eval21.invoke(config.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6927)
    at clojure.lang.Compiler.eval(Compiler.java:6916)
    at clojure.lang.Compiler.load(Compiler.java:7379)
    at clojure.lang.RT.loadResourceScript(RT.java:372)
    at clojure.lang.RT.loadResourceScript(RT.java:363)
    at clojure.lang.RT.load(RT.java:453)
    at clojure.lang.RT.load(RT.java:419)
    at clojure.core$load$fn__5677.invoke(core.clj:5893)
    at clojure.core$load.invokeStatic(core.clj:5892)
    at clojure.core$load.doInvoke(core.clj:5876)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5697)
    at clojure.core$load_one.invoke(core.clj:5692)
    at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
    at clojure.core$load_lib.invokeStatic(core.clj:5736)
    at clojure.core$load_lib.doInvoke(core.clj:5717)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$load_libs.invokeStatic(core.clj:5774)
    at clojure.core$load_libs.doInvoke(core.clj:5758)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$require.invokeStatic(core.clj:5796)
    at clojure.core$require.doInvoke(core.clj:5796)
    at clojure.lang.RestFn.invoke(RestFn.java:436)
    at figwheel_sidecar.build_utils$eval15$loading__5569__auto____16.invoke(build_utils.clj:1)
    at figwheel_sidecar.build_utils$eval15.invokeStatic(build_utils.clj:1)
    at figwheel_sidecar.build_utils$eval15.invoke(build_utils.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6927)
    at clojure.lang.Compiler.eval(Compiler.java:6916)
    at clojure.lang.Compiler.load(Compiler.java:7379)
    at clojure.lang.RT.loadResourceScript(RT.java:372)
    at clojure.lang.RT.loadResourceScript(RT.java:363)
    at clojure.lang.RT.load(RT.java:453)
    at clojure.lang.RT.load(RT.java:419)
    at clojure.core$load$fn__5677.invoke(core.clj:5893)
    at clojure.core$load.invokeStatic(core.clj:5892)
    at clojure.core$load.doInvoke(core.clj:5876)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5697)
    at clojure.core$load_one.invoke(core.clj:5692)
    at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
    at clojure.core$load_lib.invokeStatic(core.clj:5736)
    at clojure.core$load_lib.doInvoke(core.clj:5717)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$load_libs.invokeStatic(core.clj:5774)
    at clojure.core$load_libs.doInvoke(core.clj:5758)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$require.invokeStatic(core.clj:5796)
    at clojure.core$require.doInvoke(core.clj:5796)
    at clojure.lang.RestFn.invoke(RestFn.java:930)
    at figwheel_sidecar.repl_api$eval9$loading__5569__auto____10.invoke(repl_api.clj:1)
    at figwheel_sidecar.repl_api$eval9.invokeStatic(repl_api.clj:1)
    at figwheel_sidecar.repl_api$eval9.invoke(repl_api.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6927)
    at clojure.lang.Compiler.eval(Compiler.java:6916)
    at clojure.lang.Compiler.load(Compiler.java:7379)
    at clojure.lang.RT.loadResourceScript(RT.java:372)
    at clojure.lang.RT.loadResourceScript(RT.java:363)
    at clojure.lang.RT.load(RT.java:453)
    at clojure.lang.RT.load(RT.java:419)
    at clojure.core$load$fn__5677.invoke(core.clj:5893)
    at clojure.core$load.invokeStatic(core.clj:5892)
    at clojure.core$load.doInvoke(core.clj:5876)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5697)
    at clojure.core$load_one.invoke(core.clj:5692)
    at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
    at clojure.core$load_lib.invokeStatic(core.clj:5736)
    at clojure.core$load_lib.doInvoke(core.clj:5717)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$load_libs.invokeStatic(core.clj:5774)
    at clojure.core$load_libs.doInvoke(core.clj:5758)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$require.invokeStatic(core.clj:5796)
    at clojure.core$require.doInvoke(core.clj:5796)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at user$eval5.invokeStatic(form-init13598116903115428154.clj:1)
    at user$eval5.invoke(form-init13598116903115428154.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6927)
    at clojure.lang.Compiler.eval(Compiler.java:6916)
    at clojure.lang.Compiler.load(Compiler.java:7379)
    at clojure.lang.Compiler.loadFile(Compiler.java:7317)
    at clojure.main$load_script.invokeStatic(main.clj:275)
    at clojure.main$init_opt.invokeStatic(main.clj:277)
    at clojure.main$init_opt.invoke(main.clj:277)
    at clojure.main$initialize.invokeStatic(main.clj:308)
    at clojure.main$null_opt.invokeStatic(main.clj:342)
    at clojure.main$null_opt.invoke(main.clj:339)
    at clojure.main$main.invokeStatic(main.clj:421)
    at clojure.main$main.doInvoke(main.clj:384)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
    at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)
    at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:374)
    at clojure.lang.RT.classForName(RT.java:2168)
    at clojure.lang.RT.classForNameNonLoading(RT.java:2181)
    at cljs.util$eval2668$loading__5569__auto____2669.invoke(util.cljc:9)
    at cljs.util$eval2668.invokeStatic(util.cljc:9)
    at cljs.util$eval2668.invoke(util.cljc:9)
    at clojure.lang.Compiler.eval(Compiler.java:6927)
    at clojure.lang.Compiler.eval(Compiler.java:6916)
    at clojure.lang.Compiler.load(Compiler.java:7379)
    ... 181 more
Subprocess failed

I'm running brand-spanking new installations of Java, Clojure, ClojureScript, and Figwheel. This is effectively the result of the following, on Mac OS, executed today:

> brew cask install java
> brew install clojure
> brew install leiningen
> git clone https://github.com/bhauman/flappy-bird-demo.git
> cd flappy-bird-demo
> lein figwheel

Versions:

Java: 10.0.1
Clojure: 1.8.0
Leiningen: 2.8.1

FWIW, the hello-world option for getting started works just fine. Also: apologies if I should be barking up some other tree. Thanks!

tirkarthi commented 6 years ago

@kredati please try with Clojurescript 1.10.234 in the project.clj of the flappy bird demo.

core.async 0.3.442 if you are going to use clojure 1.9 and above.

Hope it helps.

Thanks.

kredati commented 6 years ago

Thanks for the quick reply!

Downgrading the Clojurescript and core.async versions didn't help, and produces the identical error, sorry to say.

Ultimately, I suspect it's user error on my end, but I don't know enough (coming from JS-land) to know what it is I've got munged up. That said, I'm happy to help figure out what the problem might be so other beginners don't get caught up with the same bug. Also am not especially looking for tech support.

Thanks!

danielcompton commented 6 years ago

@kredati I could verify the same issues you had on https://github.com/bhauman/flappy-bird-demo. On that project, the dependencies were a bit older, so compilation would fail. I've made a PR to update the dependencies there, if you apply those changes to your local copy everything should run ok.

I also wrote a more detailed guide on upgrading at https://www.deps.co/blog/how-to-upgrade-clojure-projects-to-use-java-9/ which covers why these changes need to be made.

Jarzka commented 5 years ago

I got this same error with OpenJDK 11.

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

After trying this, I get another error:

java.lang.module.FindException: Module java.xml.bind not found

EDIT: I resolved it by adding this as a dependency: [javax.xml.bind/jaxb-api "2.4.0-b180830.0359"]

danielcompton commented 5 years ago

@Jarzka that module is completely gone from the JDK in JDK11, hence needing to add it as a dependency. See https://www.deps.co/blog/how-to-upgrade-clojure-projects-to-use-java-11/ for more details on the upgrade to JDK11.