Scala on MAC(1)Environment on MAC
Download the 3.7 version of eclipse, do not use the latest 4.2 ones.
The plugin URL is as follow: http://download.scala-ide.org/releases-29/stable/site
Download the scala file from URL http://www.scala-lang.org/downloads/distrib/files/scala-2.9.2.tgz
file name is scala-2.9.2.tgz
Unzip the file and copy to my tool directory, link this directory to /opt
>sudo ln -s /Users/username/tool/scala-2.9.2 /opt/scala
>sudo vi ~/.profile
export SCALA_HOME=/opt/scala
export PATH=/opt/scala/bin:$PATH
>. ~/.profile
Verify the installation with below command
>scalac -version
Carls-MacBook-Pro:opt carl$ scalac -version
Scala compiler version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL
Use command to enter the scala
>scala
scala>1+2
2. Import and Learn sample project
Install some other plugins
MAVEN
http://m2eclipse.sonatype.org/sites/m2e
GIT
http://download.eclipse.org/egit/updates
Android
https://dl-ssl.google.com/android/eclipse/
3. Try the first example
>vi hello.scala
object HelloWorld{ def main(args: Array[String]){
println("Happy Valenten's Day, Kiko.")
}
}
>scala hello.scala
4. Try the IDE with eclipse
package com.sillycat.easyscala.bak
object Love {
//args parameter name
//Array[String] parameter type
//Unit return type, equals to void
def main(args: Array[String]): Unit = {
//val is equals to final String exp
val exp: String = "Happy Valenten's Day"
val name = "Kiko"
//String v = ""
var v = exp + ", " + name
println(v)
}
}
references:
http://sillycat.iteye.com/blog/1405907
http://sillycat.iteye.com/blog/1536386
http://sillycat.iteye.com/blog/1536391
http://sillycat.iteye.com/blog/1536392
http://sillycat.iteye.com/blog/1481372
http://developer.android.com/guide/google/gcm/index.html
http://code.google.com/p/gcm/
Download the 3.7 version of eclipse, do not use the latest 4.2 ones.
The plugin URL is as follow: http://download.scala-ide.org/releases-29/stable/site
Download the scala file from URL http://www.scala-lang.org/downloads/distrib/files/scala-2.9.2.tgz
file name is scala-2.9.2.tgz
Unzip the file and copy to my tool directory, link this directory to /opt
>sudo ln -s /Users/username/tool/scala-2.9.2 /opt/scala
>sudo vi ~/.profile
export SCALA_HOME=/opt/scala
export PATH=/opt/scala/bin:$PATH
>. ~/.profile
Verify the installation with below command
>scalac -version
Carls-MacBook-Pro:opt carl$ scalac -version
Scala compiler version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL
Use command to enter the scala
>scala
scala>1+2
2. Import and Learn sample project
Install some other plugins
MAVEN
http://m2eclipse.sonatype.org/sites/m2e
GIT
http://download.eclipse.org/egit/updates
Android
https://dl-ssl.google.com/android/eclipse/
3. Try the first example
>vi hello.scala
object HelloWorld{ def main(args: Array[String]){
println("Happy Valenten's Day, Kiko.")
}
}
>scala hello.scala
4. Try the IDE with eclipse
package com.sillycat.easyscala.bak
object Love {
//args parameter name
//Array[String] parameter type
//Unit return type, equals to void
def main(args: Array[String]): Unit = {
//val is equals to final String exp
val exp: String = "Happy Valenten's Day"
val name = "Kiko"
//String v = ""
var v = exp + ", " + name
println(v)
}
}
references:
http://sillycat.iteye.com/blog/1405907
http://sillycat.iteye.com/blog/1536386
http://sillycat.iteye.com/blog/1536391
http://sillycat.iteye.com/blog/1536392
http://sillycat.iteye.com/blog/1481372
http://developer.android.com/guide/google/gcm/index.html
http://code.google.com/p/gcm/