boot-clj / boot-cljs

Boot task to compile ClojureScript programs.
Eclipse Public License 1.0
176 stars 40 forks source link

Boot fails for cljs task (can't locate boot_cljs__init.class) on Windows 10 #192

Open kirill-gerasimenko opened 6 years ago

kirill-gerasimenko commented 6 years ago

Hi,

I'm going through https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-01.md tutorial and at the stage after defining dependencies and calling boot -h I'm getting the exception below.

I'm on Windows 10 (1709), using JDK 8 (1.8.0_172), boot is installed via Chocolatey. I've reinstalled java, cleaned ~/.m2 and ~/.boot directories - exception is still there.

Please advise.

e:/projects/modern-cljs $ boot -vh
registering src\cljs [:create :modify :delete]
registering src\cljs\modern_cljs [:create :modify :delete]
sending change event
Acquired java.util.concurrent.Semaphore@6a2b953e[Permits = 0]...
Syncing project dirs to temp dirs...
Filesystem: copying modern_cljs/core.cljs...
Sync complete.
Released java.util.concurrent.Semaphore@6a2b953e[Permits = 1]...
Acquired java.util.concurrent.Semaphore@6a2b953e[Permits = 0]...
Syncing project dirs to temp dirs...
watch service closed
registering src\cljs [:create :modify :delete]
Filesystem: copying index.html...
registering src\cljs\modern_cljs [:create :modify :delete]
registering html [:create :modify :delete]
sending change event
Sync complete.
Released java.util.concurrent.Semaphore@6a2b953e[Permits = 1]...
Acquired java.util.concurrent.Semaphore@6a2b953e[Permits = 0]...
Syncing project dirs to temp dirs...
Sync complete.
Released java.util.concurrent.Semaphore@6a2b953e[Permits = 1]...
                                                  Boot.main                          Boot.java:  258
                            java.lang.reflect.Method.invoke                        Method.java:  498
            sun.reflect.DelegatingMethodAccessorImpl.invoke  DelegatingMethodAccessorImpl.java:   43
                sun.reflect.NativeMethodAccessorImpl.invoke      NativeMethodAccessorImpl.java:   62
               sun.reflect.NativeMethodAccessorImpl.invoke0       NativeMethodAccessorImpl.java     
                                              boot.App.main                           App.java:  491
                                           boot.App.runBoot                           App.java:  399
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke        ClojureRuntimeShimImpl.java:  150
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke        ClojureRuntimeShimImpl.java:  159
                                    clojure.lang.Var.invoke                           Var.java:  394
                                            boot.main/-main                           main.clj:  216
                                         boot.main/-main/fn                           main.clj:  216
                                   clojure.core/load-string                           core.clj: 3943
                                   clojure.core/load-reader                           core.clj: 3933
                                 clojure.lang.Compiler.load                      Compiler.java: 7174
                                 clojure.lang.Compiler.load                      Compiler.java: 7227
                                 clojure.lang.Compiler.eval                      Compiler.java: 6782
                                    boot.user$eval32.invoke                                   :   11
                                 clojure.lang.RestFn.invoke                        RestFn.java:  408
                                       clojure.core/require                           core.clj: 5832
                                         clojure.core/apply                           core.clj:  632
                                clojure.lang.RestFn.applyTo                        RestFn.java:  137
                                     clojure.core/load-libs                           core.clj: 5749
                                         clojure.core/apply                           core.clj:  632
                                clojure.lang.RestFn.applyTo                        RestFn.java:  142
                                      clojure.core/load-lib                           core.clj: 5710
                                   clojure.core/load-lib/fn                           core.clj: 5711
                                      clojure.core/load-one                           core.clj: 5671
                                 clojure.lang.RestFn.invoke                        RestFn.java:  408
                                          clojure.core/load                           core.clj: 5865
                                       clojure.core/load/fn                           core.clj: 5866
                                       clojure.lang.RT.load                            RT.java:  412
                                       clojure.lang.RT.load                            RT.java:  449
java.io.FileNotFoundException: Could not locate boot_cljs__init.class or boot_cljs.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
   clojure.lang.ExceptionInfo: Could not locate boot_cljs__init.class or boot_cljs.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
    line: 11
kirill-gerasimenko commented 6 years ago

I've tried on the latest Manjaro Linux - and it has the same error.

danielsz commented 6 years ago

My guess is that you're missing the require in build.boot.

(require  '[adzerk.boot-cljs :refer [cljs]])
kirill-gerasimenko commented 6 years ago

Actually I do have it, here is the full contents of build.boot:

(set-env!
 :source-paths #{"src/cljs"}
 :resource-paths #{"html"}

 :dependencies '[[adzerk/boot-cljs "2.1.4"]])

(require '[adzerk/boot-cljs :refer [cljs]])
ckampfe commented 6 years ago

For additional data, I also have this issue. I'm on Mac OSX, Clojure 1.9.0, Java 8, boot-cljs 2.1.4, Clojurescript 1.10.312.

EDIT: this setup works if I swap Clojurescript 1.10.312 for 1.9.946.

Trace:

[nREPL] Starting server via /usr/local/bin/boot -i "(require 'cider.tasks)" -d org.clojure/tools.nrepl\:0.2.13 -d cider/piggieback\:0.3.5 -d refactor-nrepl\:2.4.0-SNAPSHOT -d cider/cider-nrepl\:0.18.0-SNAPSHOT cider.tasks/add-middleware -m refactor-nrepl.middleware/wrap-refactor -m cider.nrepl/cider-middleware -m cider.piggieback/wrap-cljs-repl repl -s wait...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Classpath conflict: org.clojure/clojure version 1.9.0 already loaded, NOT loading version 1.2.0
Classpath conflict: org.clojure/clojurescript version 1.9.946 already loaded, ALSO loading version 1.10.312
Classpath conflict: com.google.javascript/closure-compiler-externs version v20170910 already loaded, ALSO loading version v20180610
Classpath conflict: com.google.guava/guava version 20.0 already loaded, ALSO loading version 22.0
Classpath conflict: org.clojure/tools.reader version 1.1.0 already loaded, ALSO loading version 1.3.0-alpha3
Classpath conflict: com.google.javascript/closure-compiler-unshaded version v20170910 already loaded, ALSO loading version v20180610
                              java.lang.Thread.run              Thread.java:  748
java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java:  624
 java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java: 1149
               java.util.concurrent.FutureTask.run          FutureTask.java:  266
                                               ...                               
               clojure.core/binding-conveyor-fn/fn                 core.clj: 2022
                                 boot.core/boot/fn                 core.clj: 1031
                               boot.core/run-tasks                 core.clj: 1021
                    boot.task.built-in/fn/fn/fn/fn             built_in.clj:  490
                                clojure.core/deref                 core.clj: 2312
                                               ...                               
                       boot.task.built-in/fn/fn/fn             built_in.clj:  487
                                clojure.core/apply                 core.clj:  657
                                               ...                               
                            boot.core/launch-nrepl                 core.clj: 1312
                            boot.repl/launch-nrepl                 repl.clj:   60
                     boot.repl-server/start-server          repl_server.clj:   68
                        boot.repl-server/->mw-list          repl_server.clj:   59
                                               ...                               
                               clojure.core/mapcat                 core.clj: 2775 (repeats 2 times)
                                clojure.core/apply                 core.clj:  657
                                               ...                               
                               clojure.core/map/fn                 core.clj: 2747
                        boot.repl-server/->mw-list          repl_server.clj:   55
                            boot.repl-server/->var          repl_server.clj:   49
                                               ...                               
                              clojure.core/require                 core.clj: 5947 (repeats 2 times)
                                clojure.core/apply                 core.clj:  659
                                               ...                               
                            clojure.core/load-libs                 core.clj: 5909
                            clojure.core/load-libs                 core.clj: 5925
                                clojure.core/apply                 core.clj:  659
                                               ...                               
                             clojure.core/load-lib                 core.clj: 5868
                             clojure.core/load-lib                 core.clj: 5887
                          clojure.core/load-lib/fn                 core.clj: 5888
                             clojure.core/load-one                 core.clj: 5848
                                               ...                               
                                 clojure.core/load                 core.clj: 6029
                                 clojure.core/load                 core.clj: 6045
                              clojure.core/load/fn                 core.clj: 6046
                                               ...                               
                         cider.piggieback/eval2558           piggieback.clj:    1
         cider.piggieback/eval2558/loading--auto--           piggieback.clj:    1
                                               ...                               
                              clojure.core/require                 core.clj: 5947 (repeats 2 times)
                                clojure.core/apply                 core.clj:  659
                                               ...                               
                            clojure.core/load-libs                 core.clj: 5909
                            clojure.core/load-libs                 core.clj: 5925
                                clojure.core/apply                 core.clj:  659
                                               ...                               
                             clojure.core/load-lib                 core.clj: 5868
                             clojure.core/load-lib                 core.clj: 5887
                          clojure.core/load-lib/fn                 core.clj: 5888
                             clojure.core/load-one                 core.clj: 5848
                                               ...                               
                                 clojure.core/load                 core.clj: 6029
                                 clojure.core/load                 core.clj: 6045
                              clojure.core/load/fn                 core.clj: 6046
                                               ...                               
                           java.lang.Class.forName               Class.java:  348
                          java.lang.Class.forName0                Class.java     
java.lang.NoClassDefFoundError: Could not initialize class cljs.repl__init
    clojure.lang.ExceptionInfo: Could not initialize class cljs.repl__init
    line: 1
justindbelanger commented 6 years ago

@ckampfe I'm having the same problem as you, right down to the stack trace. Maybe it's due to those Classpath conflict errors?