scala(1)win7 Envirenment and Introduction
scala(1)win7 Envirenment and Introduction
1. build the envirenment
download the related files:
http://www.scala-lang.org/downloads/distrib/files/scala-2.9.1.final-devel-docs.tgz
http://www.scala-lang.org/downloads/distrib/files/scala-2.9.1.final-installer.jar
http://www.scala-lang.org/downloads/distrib/files/scala-2.9.1.final.zip
download the latest eclipse
http://download.actuatechina.com/eclipse/technology/epp/downloads/release/indigo/SR1/eclipse-jee-indigo-SR1-win32-x86_64.zip
It is said that eclipse 3.7 is not perfect supported. I still try the latest plugin with latest eclipse:
http://download.scala-ide.org/releases-29/stable/site
Unzip the file scala-2.9.1.final.zip to directory D:\tool\scala-2.9.1.final.
Add SCALA_HOME to system configuration. Add D:\tool\scala-2.9.1.final\bin to path in system.
Verify the installation with this command.
>scalac -version
Scala compiler version 2.9.1.final -- Copyright 2002-2011, LAMP/EPFL
>scala
scala>1 + 2
2. Try the first example with hello world
create a textual file with name hello.scala, the content is as follow:
object HelloWorld{
def main(args: Array[String]){
println("Happy Valenten's Day, Kiko.")
}
}
D:\work\scala>scala hello.scala
Happy Valenten's Day, Kiko.
3. Try with my IDE eclipse 3.7
After install the scala plugin, I will create the first scala project named easyscala. Then create the package named com.sillycat.easyscala.
After that, create a scala object named Love under that package. The codes are like this, and we can run as scala application in eclipse:
package com.sillycat.easyscala
object Love {
def main(args: Array[String]) {
println("Happy Valenten's Day, Kiko.")
}
}
references:
http://www.scala-lang.org/
http://scala-ide.org/
http://scala-ide.org/download/current.html
http://www.scala-lang.org/node/310
http://willerce.com/post/windows-scala
http://www.oseye.net/kb/show/1945
http://www.scala-lang.org/downloads/distrib/files/website/doc/ProgrammingInScala.pdf
http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaReference.pdf
http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaOverview.pdf
http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaTutorial.pdf
http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaByExample.pdf