clojure-emacs / cider-nrepl

A collection of nREPL middleware to enhance Clojure editors with common functionality like definition lookup, code completion, etc.
https://docs.cider.mx/cider-nrepl
677 stars 176 forks source link

`make repl` fails to start a REPL with Leiningen 2.11.x #848

Closed metayan closed 7 months ago

metayan commented 7 months ago

Expected behavior

REPL should appear

Actual behavior

Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
make: *** [Makefile:171: lein-repl] Error 1

Steps to reproduce the problem

make repl

Environment & Version information

cider-nrepl version

Current master v0.45.0 v0.44.0

Java version

openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment Homebrew (build 19.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 19.0.1, mixed mode, sharing)
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.10+7-Debian-1deb12u1, mixed mode, sharing)

Operating system

macOS 10.15.7 Linux Devuan Daedalus

Leiningen & Clojure versions

Leiningen 2.11.1 on Java 19.0.1 OpenJDK 64-Bit Server VM Clojure CLI version 1.11.1.1435

vemv commented 7 months ago

Hi!

Thank you for using CIDER (and presumably, enrich-classpath?).

There's not enough information in this issue for it to be actionable. Plese attach stacktraces if any. The issue should also be reproducible in a project that we can clone.

Feel free to reopen the issue as you gather that info.

metayan commented 7 months ago

There's not enough information in this issue for it to be actionable. Plese attach stacktraces if any. The issue should also be reproducible in a project that we can clone.

Probably a misunderstanding. I'm running make repl in the cider-nrepl project directory - as is described in the README:

https://github.com/clojure-emacs/cider-nrepl/blob/9aea519b87430c3a26cd146417dd84c33bb14676/README.md?plain=1#L72-L73

I'm actually trying to investigate an issue in cider.

vemv commented 7 months ago

Sorry about the misunderstanding - I thought this issue had been created in https://github.com/clojure-emacs/cider

Either way, make repl works for me.

But lein repl should work as well. Features related to enrich-classpath won't be present, however, most times one doesn't need to debug that.

metayan commented 7 months ago

make repl works for me.

Can you please reveal which version of Clojure/Lein/Java it works on?

But lein repl should work as well.

lein repl reports roughly the same here:

Composite profiles containing maps are strongly recommended against. 
Support will be removed in future versions of Leiningen due to subtle 
unexpected behavior. Move the map from the composite profile to its own 
top-level named profile to avoid issues.
 [:test
  {:repl-options
   {:nrepl-middleware
    [cider.nrepl/wrap-apropos cider.nrepl/wrap-classpath cider.nrepl/wrap-complete
     cider.nrepl/wrap-content-type cider.nrepl/wrap-debug cider.nrepl/wrap-enlighten
     cider.nrepl/wrap-format cider.nrepl/wrap-info cider.nrepl/wrap-inspect
     cider.nrepl/wrap-macroexpand cider.nrepl/wrap-ns cider.nrepl/wrap-out
     cider.nrepl/wrap-profile cider.nrepl/wrap-refresh cider.nrepl/wrap-resource
     cider.nrepl/wrap-slurp cider.nrepl/wrap-spec cider.nrepl/wrap-stacktrace
     cider.nrepl/wrap-test cider.nrepl/wrap-trace cider.nrepl/wrap-tracker
     cider.nrepl/wrap-undef cider.nrepl/wrap-version cider.nrepl/wrap-xref]}}]
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main

Any idea what could be the cause?

vemv commented 7 months ago

The Clojure version is managed by Leiningen

$ java -version
java version "21.0.1" 2023-10-17 LTS
$ lein version
Leiningen 2.9.10

Perhaps try a git clean -fdx? (commit any changes beforehand for them not to be lost)

I also heard that the most recent Lein broke some plugins https://codeberg.org/leiningen/leiningen/pulls/39 - don't know if we're affected

Hope it helps!

metayan commented 7 months ago

Thanks. Had a clean repo already. lein repl works with Leiningen 2.9.10 and 2.10.0 Fails with 2.11.0 and 2.11.1

metayan commented 7 months ago

This issue should probably be reopened with the new title, but it doesn't seem like I can do that.

vemv commented 7 months ago

Happy we got it!

vemv commented 7 months ago

This issue should probably be reopened with the new title, but it doesn't seem like I can do that.

There's the open PR in Lein. There's nothing we can do about it but wait. Feel free to ping them

metayan commented 7 months ago

Ah, alright. Thanks for clarifying.