我用sbt打包成jar,但用java -cp却运行不了。代码:[mw_shl_code=actionscript3,true]package edu.example
object Hi {
def main(args: Array[String]){
println("Hi!")
}
}
[/mw_shl_code]
build.sbt代码:
[mw_shl_code=actionscript3,true]name := "hello"
version := "1.0"
scalaVersion := "2.10.3"[/mw_shl_code]
build.properties代码:
[mw_shl_code=actionscript3,true]sbt.version = 0.13.8[/mw_shl_code]
目录结构:
[mw_shl_code=actionscript3,true]hello/src/main/scala/edu/exmaple/hw.scala
hello/project/build.properties
hellp/build.sbt[/mw_shl_code]
在sbt交互模式下可以运行,用java -cp /home/wangpeng/zhiming/sbt/hello/target/scala-2.10/hello_2.10-1.0.jar edu.example.Hi就报错
|