- Create New Project , 之后选择Maven项目,Project SDK选择1.8 , Next
- GroupId: hohode , Artifactid: scala_test , Version: 1 , Next
- Finish
- 右下角弹框点击,Enable Auto-Import
- 在项目名scala_test上右键,Add Framework Support…
- 选择Scala,Use library: scala-sdk-2.11.8 , OK
- 在main下新建scala目录
- 在新建的scala目录上右键,Mark Directory as -> Sources Root
- 在scala目录上右键,New -> scala class -> name:FirstScala, kind: Object
1
2
3
4
5
6object FirstScala {
def main(args: Array[String]): Unit = {
val v = 1 + 2
print(v)
}
}运行测试