I installed Scala on Ubuntu using the following
sudo apt-get install scala ~$ which scala /usr/bin/scala ~$ whereis scala scala: /usr/bin/scala /usr/bin/X11/scala /usr/share/man/man1/scala.1.gz ~$ scala -version Scala code runner version 2.9.1 -- Copyright 2002-2011, LAMP/EPFL
My question is what should I put in the variable SCALA_HOME? /usr/bin ?
Today I installed scala using “apt-get install scala” and confirmed the scala jar files are located in
You should be able to set your
/usr/share/java and have it all work. I assume you want to use NetBeans so you will need to set SCALA_HOME in your .profile (or .bash_profile) rather than in your .bashrc because NetBeans won’t see any variables set in your .bashrc unless you start it from the command line
$ find / -maxdepth 6 -iname \*scala\*jar 2> /dev/null /usr/share/java/scala-dbc.jar /usr/share/java/scala-partest.jar /usr/share/java/scala-partest-2.9.1.jar /usr/share/java/scala-dbc-2.9.1.jar /usr/share/java/scalacheck.jar /usr/share/java/scalap.jar /usr/share/java/scala-library-2.9.1.jar /usr/share/java/scala-compiler-2.9.1.jar /usr/share/java/scala-library.jar /usr/share/java/scalacheck-2.9.1.jar /usr/share/java/scala-compiler.jar /usr/share/java/scala-swing-2.9.1.jar /usr/share/java/scalap-2.9.1.jar /usr/share/java/scala-swing.jar
For me its:
I determined this by doing
dpkg -L scala
This assumes you install scala using APT.
As of today I couldn’t find an easy (and reliable) way of setting this.
As per Alex (in the comment above) installing from tarball (downloaded from scala-lang.org) into /location/of/scala/untar
Then I set
export SCALA_HOME=/location/of/scala/untar in my
Everything works for now!
I had the same issue and I did some digging
This takes into account that you are using sudo dpkg -i scala-2.11.4.deb; where the debian package has been downloaded
The SCALA_HOME should be /usr/share/scala; This is based on the following
- /usr/bin/scala is a symbolic link to /usr/share/scala/bin/scala
- /usr/bin/X11/scala is also a symbolic link to
The way I see the scala package is installed in /usr/share/scala which should be your SCALA_HOME
I installed the untarred scala into
/usr/local/share as it is on the scala download site.
.bashrc, I placed the following line:
works great from terminal regardless of what directory I’m in.
If you have installed Scala using
$apt-get install scala
then, after a successful install to see where it installed, run
If this command shows you the path to scala binaries.
Now export SCALA_HOME path into either of these environment files
export SCALA_HOME=<output of pwd>
The SCALA_HOME should be the directory where you install scala from.
For example, the name of this directory may be scala-2.9.2.