2017年1月19日 星期四

Installing Scala 2.12 on CentOS 7.2 and HelloWorld.scala

http://www.scala-lang.org/files/archive/

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

tar xvf scala-2.11.4.tgz
sudo mv scala-2.11.4 /usr/lib
sudo ln -s /usr/lib/scala-2.11.4/ /usr/lib/scala
export PATH=$PATH:/usr/lib/scala/bin
scala -version
Scala code runner version 2.11.4 -- Copyright 2002-2013, LAMP/EPFL

vi HelloWorld.scala
object HelloWorld {
    def main(args: Array[String]): Unit = {
        println("Hello, world!")
    }
}

(scalac HelloWorld.scala) && ls
HelloWorld.class  HelloWorld$.class  HelloWorld.scala  scala-2.11.4.tgz


scala HelloWorld
Hello, world!

沒有留言:

張貼留言

2023 Promox on Morefine N6000 16GB 512GB

2023 Promox on Morefine N6000 16GB 512GB Software Etcher 100MB (not but can be rufus-4.3.exe 1.4MB) Proxmox VE 7.4 ISO Installer (1st ISO re...