clj-kondo / config

Please use https://github.com/clj-kondo/configs instead
Eclipse Public License 1.0
33 stars 10 forks source link

When following readme, getting "Execution error (FileNotFoundException) at clojure.main/main (main.java:40)." #11

Closed sittim closed 3 years ago

sittim commented 3 years ago

Trying to follow README.md in this repo.

Added the aliases to /deps.edn

...
:aliases {:clj-kondo/config {:extra-deps {clj-kondo/config {:git/url "https://github.com/clj-kondo/config"
                                                              :sha "b31c108bf13ece623850596363d2cb7350a5e5fe"}}
                               :main-opts ["-m" "clj-kondo.config"]}
...

Then when I run:

$ clojure -M:clj-kondo/config --lib rum --lib slingshot
Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate clj_kondo/config__init.class, clj_kondo/config.clj or clj_kondo/config.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

Full report at:
/tmp/clojure-4744463646667156614.edn
$ cat /tmp/clojure-4744463646667156614.edn
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /tmp/clojure-4744463646667156614.edn
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ {:clojure.main/message
   2   │  "Execution error (FileNotFoundException) at clojure.main/main (main.java:40).\nCould not locate clj_kondo/config_
       │ _init.class, clj_kondo/config.clj or clj_kondo/config.cljc on classpath. Please check that namespaces with dashes
       │ use underscores in the Clojure file name.\n",
   3   │  :clojure.main/triage
   4   │  {:clojure.error/class java.io.FileNotFoundException,
   5   │   :clojure.error/line 40,
   6   │   :clojure.error/cause
   7   │   "Could not locate clj_kondo/config__init.class, clj_kondo/config.clj or clj_kondo/config.cljc on classpath. Plea
       │ se check that namespaces with dashes use underscores in the Clojure file name.",
   8   │   :clojure.error/symbol clojure.main/main,
   9   │   :clojure.error/source "main.java",
  10   │   :clojure.error/phase :execution},
  11   │  :clojure.main/trace
  12   │  {:via
  13   │   [{:type java.io.FileNotFoundException,
  14   │     :message
  15   │     "Could not locate clj_kondo/config__init.class, clj_kondo/config.clj or clj_kondo/config.cljc on classpath. Pl
       │ ease check that namespaces with dashes use underscores in the Clojure file name.",
  16   │     :at [clojure.lang.RT load "RT.java" 462]}],
  17   │   :trace
  18   │   [[clojure.lang.RT load "RT.java" 462]
  19   │    [clojure.lang.RT load "RT.java" 424]
  20   │    [clojure.core$load$fn__6839 invoke "core.clj" 6126]
  21   │    [clojure.core$load invokeStatic "core.clj" 6125]
  22   │    [clojure.core$load doInvoke "core.clj" 6109]
  23   │    [clojure.lang.RestFn invoke "RestFn.java" 408]
  24   │    [clojure.core$load_one invokeStatic "core.clj" 5908]
  25   │    [clojure.core$load_one invoke "core.clj" 5903]
  26   │    [clojure.core$load_lib$fn__6780 invoke "core.clj" 5948]
  27   │    [clojure.core$load_lib invokeStatic "core.clj" 5947]
  28   │    [clojure.core$load_lib doInvoke "core.clj" 5928]
  29   │    [clojure.lang.RestFn applyTo "RestFn.java" 142]
  30   │    [clojure.core$apply invokeStatic "core.clj" 667]
  31   │    [clojure.core$load_libs invokeStatic "core.clj" 5985]
  32   │    [clojure.core$load_libs doInvoke "core.clj" 5969]
  33   │    [clojure.lang.RestFn applyTo "RestFn.java" 137]
  34   │    [clojure.core$apply invokeStatic "core.clj" 667]
  35   │    [clojure.core$require invokeStatic "core.clj" 6007]
  36   │    [clojure.main$main_opt invokeStatic "main.clj" 514]
  37   │    [clojure.main$main_opt invoke "main.clj" 510]
  38   │    [clojure.main$main invokeStatic "main.clj" 664]
  39   │    [clojure.main$main doInvoke "main.clj" 616]
  40   │    [clojure.lang.RestFn applyTo "RestFn.java" 137]
  41   │    [clojure.lang.Var applyTo "Var.java" 705]
  42   │    [clojure.main main "main.java" 40]],
  43   │   :cause
  44   │   "Could not locate clj_kondo/config__init.class, clj_kondo/config.clj or clj_kondo/config.cljc on classpath. Plea
       │ se check that namespaces with dashes use underscores in the Clojure file name."}}
  45   │
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
borkdude commented 3 years ago

@sittim Please upgrade your clojure CLI if you haven't done so already. Also try using -Sforce to see if that helps. With your data I cannot reproduce the issue:

borkdude@MBP2019 /tmp/foo $ clojure -M:clj-kondo/config --lib rum --lib slingshot
Cloning: https://github.com/clj-kondo/config
Checking out: https://github.com/clj-kondo/config at b31c108bf13ece623850596363d2cb7350a5e5fe
Downloading: org/clojure/java.classpath/0.2.2/java.classpath-0.2.2.pom from central
Downloading: org/clojure/java.classpath/0.2.2/java.classpath-0.2.2.jar from central
Copying rum config to .clj-kondo/configs/rum
Copying slingshot config to .clj-kondo/configs/slingshot
Add "configs/rum", "configs/slingshot" to :config-paths in .clj-kondo/config.edn to activate configs.
borkdude@MBP2019 /tmp/foo $ cat deps.edn
{:aliases
 {:clj-kondo/config
  {:extra-deps {clj-kondo/config {:git/url "https://github.com/clj-kondo/config"
                                  :sha "b31c108bf13ece623850596363d2cb7350a5e5fe"}}
   :main-opts ["-m" "clj-kondo.config"]}}}
sittim commented 3 years ago

OK, that worked, I upgraded the clojure cli and its fine now. Thank you.