Scala编译环境搭建(mac IDEA)

前提:Java环境已就绪

一、安装IDEA

暂忽略 

二、安装插件

1、安装Scala插件Intellij IDEA->Preferences->Configure->Plugins

在输入框中输入Scala,找到Scala后,点击右边的install按钮,完成安装后重启Intellij IDEA生效

2、创建sbt project

首先查看sbt版本

sbt about 
[info] welcome to sbt 1.4.5 (Oracle Corporation Java 1.8.0_261)
[info] This is sbt 1.4.5
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.12

File -> New -> Project

选择命令行输出对应的版本

 

 

 

 

输入test.scala,  测试如下代码

object Main {
  def main(args:Array[String])
  {
    println("Hello World!")
  }
}

 

3、创建IDEA project和HelloWorld

File -> New -> Project

src处右键 -> New -> Scala Class 输入文件名

参考资料

https://www.scala-lang.org/download/

https://www.scala-sbt.org/1.x/docs/Launcher-Configuration.html

https://github.com/sbt/sbt/releases

 

posted on 2021-02-12 16:05  cfox  阅读(553)  评论(0编辑  收藏  举报

导航