Setting up a Scala environment under Windows

Source: Internet
Author: User

A: Preparation Tool

1:JAVAJDK 1.7.0_55 or more

: www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2:scala-2.10.4.msi more stable version

: Scala-lang.org/download, click the All Downloads button to download the required Scala version

3:scala Eclipse Development Tools

: scala-idea.org

II: Install and configure environment variables

1: Manual installation of Javajdk,scala-2.10.4.msi, Scala Eclipse tool decompression

2: Configure Javajdk,scala Environment variables (by default, install JAVAJDK and Scala, computer----> Right-click Properties----> Advanced system Settings----> select advanced----> Click environment Variables----> System variable (S) column Select path and double-click into edit path, where you can view Javajdk,scala environment variables, if there is no environment variables, you need to configure this.

Three: Start Helloscala

1: Open Scala Eclipse development tool, File----> Right-click New---->scala Project----> Write project name----> Click Finish button

2: Expand Project location to src----> right-click New---->package, enter package name: Com.scala.hello

3: New object, navigate to package name----> right-click New---->scala Object, this is the new OK, the following demo

Package Com.scala.hello

Object Helloscala {
def main (args:array[string]): Unit = {
println ("Hello,scala")
}
}

Object It is a companion object in Scala, in object: All methods and properties are static

Unit: The meaning of a null value, does not return a value, you can put: Unit = Remove
Object Helloscala {
def main (args:array[string]) {
println ("Hello,scala")
}
}

Note: The end of the statement is added without semicolons;

Setting up a Scala environment under Windows

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.