Reputation: 11
I just want to install Scala in my Ubuntu. I followed these methods:
I downloaded binary files from http://www.scala-lang.org/download/2.10.6.html (scala-2.10.6.tgz)
I unzipped this tar ball in my home location
Set environment like this /.bashrc file
export SCALA_HOME="/home/beeshma/scala-2.10.6"
set PATH="$PATH:$SCALA_HOME/bin"
export PATH
But when I checked with version
within the command prompt:
beeshma@ubuntu:~$ scala -version
The program 'scala' is currently not installed. You can install it by typing: sudo apt-get install scala
So am I missing anything ?
Upvotes: 0
Views: 1038
Reputation: 31
Remove the word set
in line set PATH="$PATH:$SCALA_HOME/bin". It will work fine. The syntax for set in bash shell is not the one expected in the code listed, it is for some other shell.
Try any of the following codes:
export SCALA_HOME="/home/beeshma/scala-2.10.6"
PATH="$PATH:$SCALA_HOME/bin"
export PATH
(or)
export SCALA_HOME="/home/beeshma/scala-2.10.6"
export PATH="$PATH:$SCALA_HOME/bin"
In your case change to variable PATH
did not happen as you tried to do with 'set' in bash shell. Hence when you export the PATH
the original unchanged PATH
is still retained and exported.
Upvotes: 2
Reputation: 123
That looks like it should work (assuming you use bash) but just to confirm:
At end of ~/.bashrc file
SCALA_HOME="/home/beeshma/scala-2.10.6"
export PATH="$SCALA_HOME/bin:$PATH"
After you save the file, remember to run.
source ~/.bashrc
Also double check that you aren't overwriting your PATH variable later on.
Also, please confirm that you are editing ~/.bashrc (versus /.bashrc). I'm sure you already know this, but ~ refers to $HOME, which is where you should edit the .bashrc file.
Upvotes: 1