Scala Intallation

1. Installing Scala

The following commands have been tested, and are operational, under Ubuntu 14.10

1.1 Downloading the Latest Version
The latest version can be downloaded from the Scala site:

sudo wget http://www.scala-lang.org/files/archive/scala-2.11.6.tgz

The commands will download the scala archive to your current working directory.

1.2 Copy and Untar the Archive
I recommend copying the archive into this folder:

/usr/local/src/scala

Untar the file using this command:

sudo tar -zxvf scala-2.11.6.tgz

2. Modifying the Path

Modify both the PATH and CLASSPATH to point to the new Scala installation.

I like to use gedit to edit my environment file:

sudo gedit /etc/environment

The text in bold was added:

PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/src/scala/scala-2.11.6/bin”

export SCALA_HOME=/usr/local/src/scala/scala-2.11.6

Once the environment file is saved, reload it:

source /etc/environment

3. Verifying the Installation

If the installation and environment editing were both successful, you should be able to find the version of scala on the terminal session:

craig@U14BASEBIG01:/usr/local/src/scala/scala-2.10.4$ scala -version
Scala code runner version 2.11.6 — Copyright 2002-2013, LAMP/EPFL

You should also be able to enter the scala interactive shell by just typing scala:

craig@U14BASEBIG01:/usr/local/src/scala/scala-2.10.4$ scala
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_31).
Type in expressions to have them evaluated.
Type :help for more information.
scala>

Unable To Start Tomact in Eclipse

Exception:
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Cannot assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
at java.net.ServerSocket.bind(ServerSocket.java:375)
at java.net.ServerSocket.(ServerSocket.java:237)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
at org.apache.catalina.startup.Catalina.await(Catalina.java:777)
at org.apache.catalina.startup.Catalina.start(Catalina.java:723)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)

Solution For Linux:
1) Go to vim /etc/hosts
2) change host ipaddress