coursier icon indicating copy to clipboard operation
coursier copied to clipboard

Coursier does not check that the supposedly previously installed Java installation is still present

Open w-r-z-k opened this issue 3 years ago • 3 comments

According to the documentation, to install this on MacOS you do the following:

brew install coursier/formulas/coursier
cs setup
scala -version

This results in:

The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

w-r-z-k avatar Dec 07 '22 03:12 w-r-z-k

I am closing this issue as a duplicate of #2537.

julienrf avatar Dec 09 '22 08:12 julienrf

I don't see how this is a duplicate of #2537.

However, it was caused by having an old and incorrect:

# >>> JVM installed by coursier >>>
export JAVA_HOME=...etc...
# <<< JVM installed by coursier <<<

in my .zprofile file. That cruft was in there even though Coursier had never been installed on that machine, because the .zprofile got restored from an old backup.

I would think that Coursier should update that setting, rather than leaving the old one in there, if it see's the JVM installed by coursier bookends.

w-r-z-k avatar Dec 14 '22 04:12 w-r-z-k

Hey, I am sorry if I mis-classified the issue. It seemed to me that both issues were caused by a common problem that the binaries are not published on some architectures (including the new Apple M1).

That being said, I am happy that you figured out the issue in your case, and I agree that it would be better if Coursier could check that the Coursier-managed JVM is indeed present.

julienrf avatar Dec 14 '22 11:12 julienrf