cmd使用SBT构建scala项目

安装

通过 Windows 安装包安装 ,下载msi包下一步就可以了
https://www.scala-sbt.org/download.html

测试案例

运行一个案例helloworld
新建一个文件夹,比如sbtdemo,在里面新建一个scala文件hw.scala
内容如下

object Hi {
  def main(args: Array[String]) = println("Hi!")
}

在该目录下启动cmd,运行sbt命令启动sbt server,进入sbt命令行,执行run命令,查看结果

D:\git\sbtdemo>sbt
[warn] Neither build.sbt nor a 'project' directory in the current directory: "D:\git\sbtdemo"
c) continue
q) quit
?c
[warn] No sbt.version set in project/build.properties, base directory: D:\git\sbtdemo
[info] welcome to sbt 1.4.5 (Oracle Corporation Java 14.0.2)
[info] loading global plugins from C:\Users\xx\.sbt\1.0\plugins
[info] set current project to sbtdemo (in build file:/D:/git/sbtdemo/)
[info] sbt server started at local:sbt-server-08b14f354f24dd03ce2a
[info] started sbt server

sbt:sbtdemo> run
[info] compiling 1 Scala source to D:\git\sbtdemo\target\scala-2.12\classes ...
[info] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.12. Compiling...
[info]   Compilation completed in 19.756s.
[info] running Hi
Hi!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值