Install Scala and Scala IDE in Ubuntu 16.04 & amp; Windows

Source: Internet
Author: User
Tags scala ide

Install Scala and Scala IDE in Ubuntu 16.04 and Windows
1. Download 1.1Scala

Http://www.scala-lang.org/download/ for Windows

Http://www.scala-lang.org/download/2.11.8.html (Linux)

Below:

Download 1.2ScalaIDE

: Http://scala-ide.org/download/sdk.html

2. Install Scala in Windows

Environment: Windows10 + JDK1.7 + Scala2.11.8

2.1 installation

Here, change the installation location:

Done

2.2 test whether the installation is successful

First, set the environment variable. Mine is as follows:

D: \ ImprtantSoft \ Scala \ bin

Then, open CMD, enter scala, and press Enter. The following message is displayed, indicating that the installation is successful:

Use val and var to define variables and def to define methods. You can enter the following statements to experience Scala:

scala> 1+3res0: Int = 4scala> res0*3+5res1: Int = 17scala> res0.*(res1)res2: Int = 68scala> println("Hello World!")Hello World!scala> var msg = "Hello World!"msg: String = Hello World!scala> println(msg)Hello World!scala> def max(x:Int,y:Int):Int=if(x<y) y else xmax: (x: Int, y: Int)Intscala> max(3,9)res5: Int = 9scala> val m = max _m: (Int, Int) => Int = <function2>scala> m(4,1)res6: Int = 4

Use IntelliJ IDEA to write Scala and run it in Spark

Scala Programming complete Chinese version PDF

Quick learning Scala (Chinese complete scan version) PDF

Install Scala 2.10.x in Ubuntu

3. Install Scala2.11.83.1 in Ubuntu 16.04 LTS

Since I downloaded the tgz file in Windows, I need to upload it to Ubuntu. Here I use WinSCP (Same principle as FTP), First connect to Ubuntu:

Create the scala-evn folder under the home/user name/file, and drag the tgz file into it:

Enter the VM:

Ctrl + Alt + T open the console, go to the spark-evn folder, switch to the root mode, ls to list files (easy to copy), decompress:

$ tar –xzvf scala-2.11.8.tgz

Then change the permission:

$ sudo chmod -R 777 scala-2.11.8

View files:

Then, return to the root directory and configure the environment variable PATH:

cd ~vim .bash_profile

Add environment variables:

export SCALA_HOME=/home/wangchao/spark-evn/scala-2.11.8export PATH=$SCALA_HOME/bin:$PATH

After Esc, enter: wq to save and exit.

Then execute.. bash_profile (note that there is a space)

3.2 Test

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.