我写了一个简单的 kotlin helloworld 程序 hello.kt
fun main(args: Array<String>) {
println("Hello, World!")
}
Run Code Online (Sandbox Code Playgroud)
然后我用kotlinc编译
$kotlinc hello.kt -include-runtime -d hello.jar
Run Code Online (Sandbox Code Playgroud)
没有错误并且生成了 hello.jar。当我运行它时
$java -jar hello.jar
Run Code Online (Sandbox Code Playgroud)
它说 hello.jar 中没有主要清单属性
$no main manifest attribute, in hello.jar
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚这个问题。我的 kotlin 版本是 1.3.40,JDK 版本是 1.8.0
kotlin ×1