Skip to content

Instantly share code, notes, and snippets.

@weiwen99
Forked from Antwnis/install_scala_centos.sh
Last active February 24, 2018 02:49
Show Gist options
  • Save weiwen99/bb150533265d84895f19 to your computer and use it in GitHub Desktop.
Save weiwen99/bb150533265d84895f19 to your computer and use it in GitHub Desktop.
# Install Scala 2.11.6 on CentOS 7
export SCALA_VERSION=scala-2.11.6
export SCALA_HOME=/opt/scala
echo "SCALA_HOME=${SCALA_HOME}" > /etc/profile.d/scala.sh
echo "export SCALA_HOME" >> /etc/profile.d/scala.sh
mkdir -p ${SCALA_HOME} && cd ${SCALA_HOME}
if [[ ! -f ${SCALA_VERSION}.tgz ]] ; then
wget http://www.scala-lang.org/files/archive/${SCALA_VERSION}.tgz
fi
tar xvf ${SCALA_VERSION}.tgz
rm -fr ./{bin,doc,lib,man}
mv -f ${SCALA_VERSION}/* ./
rm -rf ${SCALA_VERSION}
chown -R root:root ${SCALA_HOME}
for i in {scala,scalac,scalap,fsc};
do
update-alternatives --install "/usr/bin/${i}" "${i}" "${SCALA_HOME}/bin/${i}" 1
done
echo "Installation Compeleted!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment