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

scala 2.12.1 runner tries to use unset $JAVA_HOME #10098

Closed
scabug opened this issue Dec 7, 2016 · 7 comments
Closed

scala 2.12.1 runner tries to use unset $JAVA_HOME #10098

scabug opened this issue Dec 7, 2016 · 7 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Dec 7, 2016

If environment variable JAVA_HOME is unset (like it's supposed to be) then when scala and scalac get to these lines added in bfa7ade0db ...

  # Note that the version numbers go 1.7, 1.8, 9, 10, ...
  java_release="$(cat $JAVA_HOME/release | grep JAVA_VERSION)"

...it's the empty string and that translates into cat /release which obviously doesn't exist. So,

% /p/inst/scala-2.12.1/bin/scala
cat: /release: No such file or directory
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112).
Type in expressions for evaluation. Or try :help.

scala>
@scabug
Copy link
Author

@scabug scabug commented Dec 7, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10098?orig=1
Reporter: @paulp
Affected Versions: 2.12.1

@scabug
Copy link
Author

@scabug scabug commented Dec 7, 2016

@retronym said:
I think we should just uncondtionally set the scala.boot.classpath system property and jettison my failed attempt to cleanly to this conditionally for Java 9+.

My environment sets JAVA_HOME and adds JAVA_HOME/bin to the path when I switch JDKs, which is why I haven't noticed this.

@scabug
Copy link
Author

@scabug scabug commented Dec 7, 2016

@scabug scabug closed this Dec 14, 2016
@scabug
Copy link
Author

@scabug scabug commented Mar 17, 2017

@som-snytt said:
Thanks, I hit this on a clean VM with an alternate JVM, so I thought at first it was due to weird java. Naturally it's after midnight again. It's the little things.

@scabug scabug added this to the 2.12.2 milestone Apr 7, 2017
@xuwei-k
Copy link

@xuwei-k xuwei-k commented Nov 11, 2017

regression Scala 2.11.12

$ scala
cat: /release: No such file or directory
Welcome to Scala 2.11.12 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_151).
Type in expressions for evaluation. Or try :help.

@adriaanm
Copy link
Contributor

@adriaanm adriaanm commented Nov 14, 2017

Looks like we forgot to backport scala/scala@60ea98e :(

@SethTisue
Copy link
Member

@SethTisue SethTisue commented Mar 12, 2018

a PR backporting the fix to 2.11.x for a potential eventual 2.11.13 release would be welcome.

EDIT: never mind, already happened at scala/scala#6205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants