当前位置:网站首页>Scala installation and development environment configuration tutorial
Scala installation and development environment configuration tutorial
2022-04-21 12:15:00 【smileNicky】
development environment :
- jdk1.8+
- IntelliJ IDEA 2018
- Scala2.11.12
1、Scala Language Overview
Scala Language Overview :Scala Language is a language based on Java The virtual machine is the running environment , A static language that supports object-oriented and functional programming ,java Language is object-oriented , So the code will be relatively more modular when written , Functional programming language is relatively simple .
Development process : Martin of the Federal Institute of Technology · Odysky (Martin Odersky) On 2001 Design began in Scala. Martin · Odesky is a fan of compilers and programming , After a long time of programming , Hope to invent a language , It can make the basic work of writing programs more efficient , Simple . Martin · Odersky yes JAVA This door is portable , Running on the network , And the language of garbage collection has generated great interest , So I decided to integrate the features of functional programming language into JAVA in , Two languages have been invented (Pizza & Scala)
Scala Language website :https://scala-lang.org/

Add :
- Static language : Static language ( Strong type language ) Is a language that can be determined by the data type of compile time variables , Most static languages require that data types be declared before variables are used . such as Java、C、C++、C# etc. .
- Dynamic language : Dynamic language ( Weak type language ) It is the language that determines the data type at run time , There is no need to declare the type of a variable before it is used . such as Php、Asp、JavaScript、Python、Perl wait
1、Scala Download and install
Scala The program is running in java The virtual machine , So you need to install it first jdk, Be careful jdk Version and scala Compatibility , Please refer to the official document for details :https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html

stay Scala Official website https://www.scala-lang.org/download/all.html, Find all version download pages :

3.x The download link of the version is placed in GitHub 了 , So go to GitHub download

GitHub releases link :https://github.com/lampepfl/dotty/releases/tag/3.1.2, download scala3-3.1.2.tar.gz, scala3-3.1.2.zip Fine

Scala2.x The version can be downloaded directly from the official website , There is no need to GitHub download ,scala-2.11.12.msi Is the installation version ,scala-2.11.12.zip Yes. window The green version

Environment variable configuration : Create a new one SCALA_HOME Variable

stay path add Scala environment variable %SCALA_HOME%\bin

cmd Window run , Input scala

3、IDEA according to Scala plug-in unit
Developing software can choose idea perhaps Eclipse Fine , This article takes idea For example , Click on File->Setting, find Plugins plug-in unit , Search for scala, Click on the install Install

Once installed , Need to restart IDEA that will do
4、 establish Scala project
choice File->New, choice New Project, choice Scala->IDEA, Click on Next

because jdk The version is 1.8 Of , So you can only select the corresponding Scala Sdk edition 2.x Of

After the project is created , Select project , Right click ->New->Scala class, Create a new class :
package com.scala.sample
object ScalaSample {
def main(args: Array[String]): Unit = {
println("Hello, Scala developer!")
}
}
Create a new one Application To run the Scala Program , choice main class

5、maven Way to create scala project
Of course , You can also create a new maven Project to run Scala,File->New->New Project, choice maven project :

And then choose jdk and scala sdk that will do , Same as above , All are next Operate in one step
then , After the new project ,File -> Project Structure, stay Project Settings ->Libraries page , Click on + newly added , choice Scala Sdk, Find the previously downloaded scala Just follow the directory , And then it pops up ,Choose Modules page , Select the item just now

then , This maven The project also supports scala 了 , Similarly, right click ->New->Scala Class, Create a new one Scala class :

6、 Reference material
版权声明
本文为[smileNicky]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211150349184.html
边栏推荐
- 京东云分布式数据库StarDB顺利完成多方国产化适配认证
- Oracle provides superior database performance and scale through exadata cloud infrastructure x9m
- 【软件测试系列一】《软件测试基础知识》
- hiredis和rapidjson库的使用小结
- 中商惠⺠交易中台架构演进:对 Apache ShardingSphere 的应⽤
- [Software Testing Series III] "test case writing principles and design methods"
- The basic software products of xinghuan science and technology have been fully implemented and blossomed, bringing "Star" momentum to the digital transformation of enterprises
- 云原生DaaS服务—分布式对象存储简述
- 【软件测试系列十】《压力测试方案》
- 數據庫,把另一張錶某字段數據添加到另一個錶中,同時加入的時候加入自己需要的數據
猜你喜欢
随机推荐
[software test series 12] stress test report template
【软件测试系列一】《软件测试基础知识》
分支 if语句
团队中听谁的
Reverse crawler 30 verification code of a fourth generation slider
Is it difficult to choose binary version control tools? After reading this article, you will find the answer
给定字符串提取姓名(字符串、list、re“零宽断言”)
《深度学习》学习笔记(五)
【软件测试系列十一】《压力测试场景及测试用例模板》
云原生DaaS服务—分布式对象存储简述
【软件测试系列二】《软件测试流程规范》
Wonderful linkage! Principle and practice of openmldb pulsar connector
二进制文件版本控制工具选择难?看完这篇你会找到答案
笑死!程序员延寿指南开源了
Chris LATTNER, father of llvm: the golden age of compilers
The persistence, abandonment and redemption of new consumer brands in the Shanghai epidemic
Oracle provides superior database performance and scale through exadata cloud infrastructure x9m
京东云分布式数据库StarDB顺利完成多方国产化适配认证
hiredis和rapidjson库的使用小结
nodejs 如何将 Buffer 数据转为 String










