Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leiningen hangs instead of complaining about not finding JAVA_HOME #2815

Open
4 tasks done
spiralnegative opened this issue Apr 11, 2024 · 1 comment
Open
4 tasks done

Comments

@spiralnegative
Copy link

spiralnegative commented Apr 11, 2024

Initial debugging steps
Before creating a report, especially around exceptions being thrown when running Leiningen, please check if the error still occurs after:

  • Updating to using the latest released version of Leiningen (lein upgrade).
  • Moving your ~/.lein/profiles.clj (if present) out of the way. This contains third-party dependencies and plugins that can cause problems inside Leiningen.
  • Updating any old versions of plugins in your project.clj, especially if the problem is with a plugin not working. Old versions of plugins like nREPL and CIDER (as well as others) can cause problems with newer versions of Leiningen.
  • (If you are using Java 9 or newer), updating your dependencies to their most recent versions. Recent JDK's have introduced changes which can break some Clojure libraries.

Describe the bug
When I run any lein command (e.g. lein migrate) my terminal just hangs and no output is produced. After some debugging I found out that JAVA_HOME in my .zshrc was pointing to the wrong directory. Fixing the directory also fixed my problem.

To Reproduce
Steps to reproduce the behavior:

  1. Go to your .bashrc/.zshrc/etc and change the JAVA_HOME directory to something else
  2. Check lein version - it should output the correct Java, e.g. Leiningen 2.11.2 on Java 1.8.0_401 Java HotSpot(TM) 64-Bit Server VM in my case
  3. Run any lein command - e.g. lein test

Actual behavior
Any lein command produces no output and just hangs for minutes.

Expected behavior
lein commands to output a message about wrong Java directory

Link to sample project
not relevant

Logs
not relevant

Environment

  • Leiningen Version: Leiningen 2.11.2 on Java 1.8.0_401 Java HotSpot(TM) 64-Bit Server VM
  • Leiningen installation method: Homebrew
  • JDK Version:
java version "1.8.0_401" 
Java(TM) SE Runtime Environment (build 1.8.0_401-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.401-b10, mixed mode)
  • OS: MacOS Sonoma 14.4.1 (Apple M3 Pro chip)

Additional context
not relevant

@technomancy
Copy link
Owner

I can't reproduce this running from source or installed from apt-get. Is it possible this is a distro-specific issue with the homebrew packaging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants