科特林應用正確的方法我已經有了簡單的腳本運行的gradle從任務
package com.lapots.game.journey.ims.example
fun main(args: Array<String>) {
println("Hello, world!")
}
這裏是gradle
任務
task runExample(type: JavaExec) {
main ='com.lapots.game.journey.ims.example.Example'
classpath = sourceSets.main.runtimeClasspath
}
但是當我嘗試運行任務gradle runExample
我得到錯誤
Error: Could not find or load main class com.lapots.game.journey.ims.example.Example
什麼是正確的WA ❖運行應用程序?
的可能的複製[如何運行科特林編譯後的class文件?(http://stackoverflow.com/questions/9355690/how-to-run-compiled-class-file-in-kotlin) –
有一個關於使用Gradle應用程序插件運行Kotlin應用程序的部分:http://stackoverflow.com/a/26402542/3679676 ...或者你是否需要它運行 - 如果它是一種其他方式的任務?但是這個答案也可以給你你需要的線索。 –