kotlin程序错误:jar文件中没有主清单属性 [英] kotlin program error: no main manifest attribute in jar file

查看:433
本文介绍了kotlin程序错误:jar文件中没有主清单属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个简单的kotlin helloworld程序 hello.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中没有主要的清单属性

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

推荐答案

尝试使用JDK 1.11+升级到1.3.41版.

Try to upgrade to version 1.3.41 and using JDK 1.11+.

这篇关于kotlin程序错误:jar文件中没有主清单属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆