Where Is Scala_Home on Ubuntu

Where is SCALA_HOME on Ubuntu?

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!

Scala home directory for creating Scala project in IntelliJ IDEA

The plugin wants to know where the Scala libraries are installed (as it would want to know where the Java SDK is located for a Java module). Note that for different Scala projects you might use different versions of Scala: 2.9.0 or 2.10.2, etc. The dialog offers to download them or you can go to the Scala site and download them yourself. For example, I downloaded scala-2.10.2.tgz from http://www.scala-lang.org/download/ and expanded it in /home/glenn/Applications/Scala/ to
/home/glenn/Applications/Scala/scala-2.10.2/. This latter path is what goes in the "Set Scala Home" field in the dialog.

Note that in my case this is preferable to using the apt-get installation of Scala because the API changes so much that I usually end up with different versions of Scala for different projects that I experiment with.

Follow the version links at http://www.scala-lang.org/download/all.html to the version page with the download for the docs.

Note that for me, IDEA wanted the docs to be in the "doc/scala-devel-docs" directory, whereas the downloaded docs decompressed to "scala-docs-2.10.2". I made a link so that IDEA can find them. My 2.10.2 directory looks like this, now.

scala-2.10.2
├── bin
├── doc
│   ├── scala-devel-docs -> scala-docs-2.10.2
│   ├── scaladoc
│   │   └── lib
│   ├── scala-docs-2.10.2
│   │   └── api
│   └── tools
│   ├── css
│   └── images
├── examples
│   ├── actors
│   ├── monads
│   ├── parsing
│   │   └── lambda
│   ├── tcpoly
│   │   └── monads
│   └── xml
│   └── phonebook
├── lib
├── man
│   └── man1
├── misc
│   └── scala-devel
│   └── plugins
└── src

How to reconfigure version of scala on ubuntu?

I personally wouldn't bother.

The binary incompatibilities across major versions mean you'll likely want more than one version available if you ever work on more than one project.

My advice is to install the latest version of SBT and use that to manage versions at a per-project level. You'll still be able to get a REPL via sbt console

Command 'scala' not found on Ubuntu 18.04

Editing .bashrc won't affect an already open shell. You could explicitly source it (source ~/.bashrc) to have it take effect, or open a new shell to reload it.

Error found when installing scala in ubuntu

You can download archive, unzip it

wget https://downloads.lightbend.com/scala/2.12.3/scala-2.12.3.tgz
sudo cp scala-2.12.3.tgz /usr/local/share/scala-2.12.3.tgz
cd /usr/local/share
sudo tar xzvf scala-2.12.3.tgz
sudo rm scala-2.12.3.tgz

and update PATH

nano ~/.bashrc

adding lines

export SCALA_HOME=/usr/local/share/scala-2.12.3
export PATH=$PATH:$SCALA_HOME/bin

Now Scala should work

$ scala
Welcome to Scala 2.12.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_144).
Type in expressions for evaluation. Or try :help.

scala> 1+1
res0: Int = 2

You can read the page https://www.scala-lang.org/download/

Unable to run spark-shell command after new Spark setup with Hadoop on Ubuntu 20.04


Spark version: spark-2.4.5-bin-without-hadoop-scala-2.12

It means that Spark is pre-built with or expecting Scala 2.12
I don't think you'd be able to run it with Scala 2.11

From what I can see at Spark compatibility page, Spark 2.4.5 is provided pre-built with either Hadoop 2.7.x or with Hadoop 3.2.x

https://spark.apache.org/downloads.html

I would suggest to either try it with one of the versions of Hadoop they recommend or install Hadoop 3.2.x+



Related Topics



Leave a reply



Submit