Scala combines object-oriented and functional programming in one concise, high-level language. Scala's static types help avoid bugs in complex applications, and its JVM and JavaScript runtimes let you build high-performance systems with easy access to huge ecosystems of libraries. Great for BigData and ML.
In this tutorial, We will be using RHEL (7.8, 8) & SLES 15
- Request access to LinuxONE Community Cloud. Follow instructions here
1.1 Install the dependencies with OpenJDK and AdoptOpenJDK
For RHEL7.8,8
# sudo yum install -y java-11-openjdk java-11-openjdk-devel wget
# sudo yum install -y tar wget
For SLES 15
# sudo zypper install -y java-11-openjdk java-11-openjdk-devel wget
# sudo zypper install -y tar wget gzip
2.1 For RHEL and SLES:
# wget http://www.scala-lang.org/files/archive/scala-2.13.3.rpm
# sudo rpm -ivh scala-2.13.3.rpm
2.2 Check Scala & Scalac version
# scala -version
Scala code runner version 2.13.3 -- Copyright 2002-2020, LAMP/EPFL and Lightbend, Inc.
# scalac -version
Scala compiler version 2.13.3 -- Copyright 2002-2020, LAMP/EPFL and Lightbend, Inc.
3.1 Create at test program
# sudo vi HelloWorld.scala
# object HelloWorld
{
def main(args: Array[String]): Unit = {
println("Hello, world!")
}
}
# wq:
# scala HelloWorld
The output of the above should result:
Hello, world!
# scala
# scala> 16*70
The output of the above should result:
val res0: Int = 1120
# scala> println("Hello Developer")
The output of the above should result:
Hello Developer