1. Download1.1Scala Downloads
Windows Edition: http://www.scala-lang.org/download/
Linux version: http://www.scala-lang.org/download/2.11.8.html
Pull to the bottom:
1.2ScalaIDE Downloads
: http://scala-ide.org/download/sdk.html
install Scala under 2.Windows
Environment: windows10+jdk1.7+scala2.11.8
2.1 Installation
Here, change the installation location:
Done
2.2 Test whether the installation was successful
First, set the environment variable, mine is this:
D:\ImprtantSoft\Scala\bin
Then, open cmd, type Scala, enter, and the following appears, indicating that the installation was successful:
Define variables with Val and Var, define the method with Def, you can enter the following statement 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) YElseXmax: (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
3.Ubuntu 16.04 lts under Installation Scala2.11.83.1 Installation
Since I am downloading the tgz file in Windows, I need to upload it to Ubuntu, which uses WINSCP (the same principle as FTP) to connect Ubuntu first:
Then create a folder named SCALA-EVN under home/username/file and drag the tgz file into:
Into the virtual machine:
Ctrl+alt+t Open the console, go to the SPARK-EVN folder, switch to root mode, ls list files (easy to copy), Unzip:
$ TAR–XZVF scala-2.11. 8. tgz
Then change the permissions:
777 scala-2.11. 8
To view files:
Then, go back to the root directory and configure the environment variable path:
CD ~vim. Bash_profile
To add an environment variable:
Export scala_home=/home/wangchao/spark-evn/scala-2.11. 8 export PATH= $SCALA _home/bin: $PATH
ESC after input: Wq Save and exit
Then execute,. . Bash_profile (Note: space between)
3.2 Testing
scalaide installation in 4.Windows
After download (for Scala 2.11.8 window version 64), unzip to the appropriate folder:
Click Eclipse to start, as with Java Eclipse.
Scala ide→new Scala project→new Scala object (note not new Scala class), analogy to create. Java file instead of creating a. class file, here is the test sequencing and (note: Scalaide, like Eclipse, has shortcuts, alt+/, and other shortcut keys).
Reprint please indicate the link:
Http://www.cnblogs.com/homewch/p/5668464.html
Installing Scala and Scalaide under Windows and Linux (Ubuntu)