Build a scala environment in linux and write a simple scala Program (Code tutorial), linuxscala
Installing the scala environment in linux is very simple. If it is a ubuntu environment, it will be simpler. You can directly use apt-get to solve the problem. I just use ubuntu. java/scala systems must be based on jdk, so jdk must be installed first.
1. Installing jdk is not worth mentioning.
2. Install scala as follows:
sudo apt-get install scala
As follows:
ubuntu@VM-0-15-ubuntu:~/taoge/scala$ scala -versionScala code runner version 2.11.6 -- Copyright 2002-2013, LAMP/EPFLubuntu@VM-0-15-ubuntu:~/taoge/scala$
Of course, you can also use the scala shell, as shown below:
ubuntu@VM-0-15-ubuntu:~/taoge/scala$ scalaWelcome to Scala version 2.11.6 (OpenJDK 64-Bit Server VM, Java 1.8.0_151).Type in expressions to have them evaluated.Type :help for more information.scala>
Well, write a scala program for testing:
ubuntu@VM-0-15-ubuntu:~/taoge/scala$ cat test.scala object HelloWorld { def main(args: Array[String]): Unit = { println("Hello, world!") }}ubuntu@VM-0-15-ubuntu:~/taoge/scala$ scala test.scala Hello, world!ubuntu@VM-0-15-ubuntu:~/taoge/scala$
Spark is written in scala, so it is necessary to understand scala.