kotlin 程序错误:jar 文件中没有主清单属性 [英] kotlin program error: no main manifest attribute in jar file
本文介绍了kotlin 程序错误:jar 文件中没有主清单属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我写了一个简单的 kotlin helloworld 程序你好.kt
I wrote a simple kotlin helloworld program hello.kt
fun main(args: Array<String>) {
println("Hello, World!")
}
然后我用kotlinc编译
Then I compiled it with kotlinc
$kotlinc hello.kt -include-runtime -d hello.jar
没有错误并且生成了 hello.jar.当我运行它
there was no errors and hello.jar was generated. when I ran it
$java -jar hello.jar
说hello.jar中没有main manifest属性
it said there is no main manifest attribute in hello.jar
$no main manifest attribute, in hello.jar
我无法弄清楚这个问题.我的kotlin版本是1.3.40,JDK版本是1.8.0
I couldn't figure out this problem. My kotlin version is 1.3.40, JDK version is 1.8.0
推荐答案
尝试升级到 1.3.41 版本并使用 JDK 1.11+.
Try to upgrade to version 1.3.41 and using JDK 1.11+.
这篇关于kotlin 程序错误:jar 文件中没有主清单属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文