Table of Contents
Scala depends on Java, so please install Java first. In this tutorial, we installed JDK to:
Install Scala from the Fedora yum repository
In the repository for Fedora 17, it is scala 2.9.2
# yum install scala
Prepare the Java environment for Scala
However, if you invoke
scala directly after installed it, you will likely get an error message like this:
/usr/bin/scala: error: JVM_LIBDIR /usr/lib/jvm-exports/java does not exist or is not a directory
It looks there is something related to Java is not correct.
/bin/scala and searching for Java, the first line that sets up a red flag is:
I don’t understand why the JAVA_HOME should be hard coded. I don’t want to change the files for Scala neither so that I need not to edit the file every time I update it.
So to make Scala happy, let’s prepare the directories for it.
Prepare the jvm-exports directory:
$ cd /usr/lib/jvm-exports/ $ sudo ln -s /usr/java/jdk1.6.0_24/lib/ ./java
Prepare the jvm directory:
$ cd /usr/lib/jvm $ sudo ln -s /usr/java/jdk1.6.0_24/ ./java
By now, scala should work in Fedora 17 Linux.