Tag: 命令行界面

将Kotlin .class文件打包到JAR中执行

在关于“Kotlin – 编译并从Windows命令行运行”的教程之后,有一个缺失的清单: thufir@dur:~/kotlin$ thufir@dur:~/kotlin$ ll total 32 drwxr-xr-x 2 thufir thufir 4096 Oct 27 08:29 ./ drwx—— 46 thufir thufir 16384 Oct 27 08:03 ../ -rw-r–r– 1 thufir thufir 107 Oct 27 08:29 HelloWorld.kt thufir@dur:~/kotlin$ thufir@dur:~/kotlin$ kotlinc HelloWorld.kt -include-runtime -d HelloWorld.jar WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by […]

错误:无法找到或加载主类Hello.class

尝试最简单的kotlin你好世界可能: thufir@dur:~/kotlin$ thufir@dur:~/kotlin$ ll total 32 drwxr-xr-x 2 thufir thufir 4096 Oct 27 07:28 ./ drwx—— 46 thufir thufir 16384 Oct 27 06:47 ../ -rw-r–r– 1 thufir thufir 104 Oct 27 07:27 Hello.kt thufir@dur:~/kotlin$ thufir@dur:~/kotlin$ kotlinc Hello.kt WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.util.text.StringFactory to constructor java.lang.String(char[],boolean) WARNING: […]