question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

/usr/libexec/java_home does not work with Java installed via coursier

See original GitHub issue

Steps

~ eval "$(cs java --jvm 11 --env)"
~ java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
~ /usr/libexec/java_home
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
~

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mushtaqcommented, Apr 24, 2020

I see. Will raise an issue in jep repo then. They should be directly using the value of $JAVA_HOME rather than replying on /usr/libexec/java_home

1reaction
mushtaqcommented, Apr 24, 2020

One more thing, the external program is jep. And pip install jep throws:

Collecting jep
  Using cached jep-3.9.0.tar.gz (3.0 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/mushtaqahmed/Downloads/polynote/.venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8d/nrdzx4s96fnchgk89vlcbbyh0000gn/T/pip-install-47z9ggl5/jep/setup.py'"'"'; __file__='"'"'/private/var/folders/8d/nrdzx4s96fnchgk89vlcbbyh0000gn/T/pip-install-47z9ggl5/jep/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/8d/nrdzx4s96fnchgk89vlcbbyh0000gn/T/pip-install-47z9ggl5/jep/pip-egg-info
         cwd: /private/var/folders/8d/nrdzx4s96fnchgk89vlcbbyh0000gn/T/pip-install-47z9ggl5/jep/
    Complete output (9 lines):
    numpy include found at /Users/mushtaqahmed/Downloads/polynote/.venv/lib/python3.7/site-packages/numpy/core/include
    Traceback (most recent call last):
      File "/private/var/folders/8d/nrdzx4s96fnchgk89vlcbbyh0000gn/T/pip-install-47z9ggl5/jep/commands/java.py", line 36, in get_java_home
        result = shell('/usr/libexec/java_home')
      File "/private/var/folders/8d/nrdzx4s96fnchgk89vlcbbyh0000gn/T/pip-install-47z9ggl5/jep/commands/util.py", line 104, in shell
        raise CommandError(message=msg, result=result)
    commands.util.CommandError: Encountered an error (return code 1) while executing '/usr/libexec/java_home'
    Error:
    Include folder should be at '/System/Library/Frameworks/JavaVM.framework/Headers' but doesn't exist. Please check you've installed the JDK properly.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Read more comments on GitHub >

github_iconTop Results From Across the Web

/usr/libexec/java_home is complete… | Apple Developer Forums
The problem of /usr/libexec/javahome not working correctly if JAVAHOME is set is one problem, and you can hack that in your shell profile...
Read more >
java - Coursier
The java and java-home commands fetch and install JVMs. The java command runs them too. If a JVM is already installed on your...
Read more >
Why command /usr/libexec/java_home doesn't work?
I used the /usr/libexec/java_home command to change java version. Some programs run need to special version. so I installed multi versions of ...
Read more >
scalameta/metals - Gitter
When I open a workspace that's under $HOME, using the /home path; actions will fail with a ...because it doesn't belong to a...
Read more >
Android Studio Setup Guide for Mac - Amazon S3
open Terminal and type javac -version. If you have. Java 6.0 or greater, continue to the next slide: Set Your. JAVA_HOME. If JDK...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found