0

Yes, I know this is almost exactly the same as this question:

Getting "cat: /release: No such file or directory" when running scala

Well - I am brand new to submitting to SO and to Scala as well, so I wanted to ask a clarification question in the comments but can't at sub 50 reputation, so I apologize in having to pose my question here. The User answered their own question - and I needed an elaboration on what they did.

I get cat: /release: No such file or directory whenever I run scalac myScalaClass.sc or scala myScalaClass directly from terminal OR from when I open and run Scala from bin/scala the message appears at the top before the scripting portion opens.

Any ideas on the fix? The original OP said

My $JAVA_HOME wasn't set. But I'm not sure what they mean by this.

Thanks!


(Elaborated) Solution: My Java_HOME was blank, meaning it was not set properly.

Taken from the link provided in the answer by @Xander88. The checked answer there did it. All I had to do was copy and paste this in to Terminal, you can also manually copy it in to your ~/.bash_profile :

export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"

Community
  • 1
  • 1
NateH06
  • 3,154
  • 7
  • 32
  • 56
  • 1
    Possible duplicate of [Getting "cat: /release: No such file or directory" when running scala](http://stackoverflow.com/questions/41193331/getting-cat-release-no-such-file-or-directory-when-running-scala) – Jörg W Mittag Jan 11 '17 at 11:05

1 Answers1

2

Try to do this command in terminal and make sure it is set properly

echo $JAVA_HOME

If you don't see anything, then you have to make sure you set your path for the environmental variable $JAVA_HOME

Try referring to this article to get you started if you are on a Mac with 10.12 Sierra. Where is JAVA_HOME on OSX Sierra (10.12), El Captain (10.11), Yosemite (10.10), Mavericks (10.9), Mountain Lion (10.8) or OSX Lion (10.7)?

Community
  • 1
  • 1
Xander88
  • 36
  • 1
  • 4