user875921
user875921

Reputation: 11

Unable to install scala

I just want to install Scala in my Ubuntu. I followed these methods:

  1. I downloaded binary files from http://www.scala-lang.org/download/2.10.6.html (scala-2.10.6.tgz)

  2. I unzipped this tar ball in my home location

  3. 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

Answers (2)

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

justanotherbrain
justanotherbrain

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

Related Questions