Where is SCALA_HOME on Ubuntu?

给你一囗甜甜゛ 提交于 2019-11-30 01:28:39
Tim Perry

Today I installed scala using "apt-get install scala" and confirmed the scala jar files are located in /usr/share/java

You should be able to set your SCALA_HOME to /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
Jeremy

For me its: /usr/share/java/scala I determined this by doing dpkg -L scala

This assumes you install scala using APT.

Soumya Simanta

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 .bashrc 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 /usr/share/scala/bin/scala

The way I see the scala package is installed in /usr/share/scala which should be your SCALA_HOME

wayneeusa

I installed the untarred scala into /usr/local/share as it is on the scala download site.

In my .bashrc, I placed the following line:

export PATH="/usr/local/share/scala-2.11.8/bin:$PATH"

works great from terminal regardless of what directory I'm in.

user4452661

If you have installed Scala using

$apt-get install scala

then, after a successful install to see where it installed, run

which scala

If this command shows you the path to scala binaries. Now run

pwd

Now export SCALA_HOME path into either of these environment files

~/.bashrc

or

/etc/profile

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!