Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

DT big data DreamWorks-Scala Learning Notes (1): Scala Development Environment Construction and HelloWorld Analysis

2025-03-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

First, scala is a combination of functional programming and object-oriented programming. What are the characteristics of these two kinds of programming?

A: functional programming is good at numerical calculation; object-oriented programming is especially suitable for the organization of large projects or projects, as well as the division of labor and cooperation among teams.

Second, the characteristics of Scala

Scala is elegant in structure, exquisite in calculation and expressive.

What resources are needed for the installation of scala?

Java, it is recommended to install Java8 (Java7 is also possible)

Support scala 2.10.* or above (2.10.4, http://scala-lang.org/download can be installed)

4. Set environment variable (system variable):

(1) JAVA_HOME and SCALA_HOME

Determine the installation directory where JAVA and SCALA have been added (variables are C:\ Program Files\ Java\ jdk1.7.0_71 and C:\ Program Files (x86)\ scala, respectively)

(2) PATH

Make sure that% JAVA_HOME%\ bin and% SCALA_HOME%\ bin in the installation directory have been set in the variable value.

After adding SCALA's bin directory to PATH, use the SCALA command in any directory

(3) CLASSPATH

Add% JAVA_HOME%\ lib\ dt.jar;%JAVA_HOME%\ lib\ tools.jar to the variable value

5. View the version of the command:

Java-version

Scala

Use IDE integrated development environment to operate

1. IDEA, the first is IDEA. When developing Spark big data, IDEA is used to develop.

Because it supports JAVA and SCALA very well, and other supports are very good.

2. ScalaIDE (for eclipse), download, decompress and use it.

Beginners are strongly recommended to use ScalaIDE (for eclipse)

7. Establish the first procedure:

1. Create a project

Named: ScalaInAction

2. Create a package in the source code (easy to manage)

Set up packet under src

Named: com.dt.scala.hello

3. Create an object (after creating a package, you can write a program in it)

Named: HelloScala

Check "public static void main (String [] args)"

(Scala Object is a static object in the Scala class, and we have the main method entry of Scala in Scala Object)

Run As

The information comes from: DT big data DreamWorks Wechat Public account: DT_Spark

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report