$ java -version
java version "1.7.0_171"
OpenJDK Runtime Environment (rhel-2.6.13.0.el7_4-x86_64 u171-b01)
OpenJDK 64-Bit Server VM (build 24.171-b01, mixed mode)
For scala to be set up JDK 8 or greater version is required
if JDK/OpenJDK version is less than 1.8 then follow the below steps
$cd /opt
$mkdir java
$cd java
$wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz
$tar -zxvf jdk-8u201cd jdk1.8.0_201-linux-x64.tar.gz
$pwd
$cd jdk1.8.0_201 #cd jdk1.8.*
$update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_201/bin/java 100
$update-alternatives --config java
$update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.8.0_201/bin/javac 100
$update-alternatives --config javac
$update-alternatives --install /usr/bin/jar jar /opt/java/jdk1.8.0_201/bin/jar 100
$update-alternatives --config jar
$export JAVA_HOME=/opt/java/jdk1.8.0_201/
$export JRE_HOME=/opt/java/jdk1.8.0_201/jre
$export PATH=$PATH:/opt/java/jdk1.8.0_201/bin:/opt/java/jdk1.8.0_201/jre/bin
$java -version
#creating en empty folder linux file system
$mkdir app
$cd app
#scala 2.11.6
$wget www.scala-lang.org/files/archive/scala-2.11.6.tgz
$tar -xvzf scala-2.11.6.tgz
$cd scala-2.11.6
$cd bin
#Invoking scala commands - check if it is working from command line
./scala
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_201).
Type in expressions to have them evaluated.
Type :help for more information.
scala>
#Add below path to your ./bashrc or .profile
$export PATH=/app/scala-2.11.6/bin:$PATH
$cd ../opt
$mkdir sbt
#for RHEL/centOS - Linus distributions
$curl https://bintray.com/sbt/rpm/rpm | sudo tee /etc/yum.repos.d/bintray-sbt-rpm.repo
$sudo yum install sbt