IDEA搭建Scala项目-helloworld

阿飞 2021年08月05日 947次浏览

安装Scala插件

  • 打开idea的settings
  • 进入plugins,搜索Scala
  • 安装

image-20210805211952315

安装Scala sdk

官网

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

根据环境自由选择

image-20210805212202950

IDEA自动下载

image-20210805212521456

  • 项目模块上右键,选择 add framework support,选择Scala,然后下载适当的SDK

image-20210805212726228

Hello word

新建Scala源码目录,新建Scala class,类型选Object

image-20210805212928402

编写代码

object Demo {

  def main(args: Array[String]): Unit = {
    println("hello world")
  }

}
hello world