Build a scala environment in linux and write a simple scala Program (Code tutorial), linuxscala

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.