Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script to install Oracle Java 1.8, Scala 2.11.7 and sbt 0.13.9 on Ubuntu 14.04
#!/bin/bash
#
# Script to Install
# Oracle Java 1.8
# Scala 2.11.7
# sbt 0.13.9
#
##############################
#Script must be run as root/sudo
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with admin privileges 'sudo'"
echo "exiting...."
exit 1
fi
#Install Oracle Java 1.8
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get -y install oracle-java8-installer
#Install Scala 2.11.7
wget http://downloads.typesafe.com/scala/2.11.7/scala-2.11.7.tgz
tar -xvf scala-2.11.7.tgz
mkdir /usr/lib/scala
mv scala-2.11.7 /usr/lib/scala/
touch /usr/bin/scala
ln -fs /usr/lib/scala/scala-2.11.7/bin/scala /usr/bin/scala
touch /usr/bin/scalac
ln -fs /usr/lib/scala/scala-2.11.7/bin/scalac /usr/bin/scalac
#Install sbt 0.13.9
wget https://dl.bintray.com/sbt/native-packages/sbt/0.13.9/sbt-0.13.9.tgz
tar -xvf sbt-0.13.9.tgz
mkdir /usr/lib/sbt
mv sbt /usr/lib/sbt/sbt-0.13.9
touch /usr/bin/sbt
ln -fs /usr/lib/sbt/sbt-0.13.9/bin/sbt /usr/bin/sbt
#Need to run this to download needed jar files
sbt -version
#Clean up
rm sbt-0.13.9.tgz
rm scala-2.11.7.tgz
java -version
scala -version
sbt sbtVersion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.