KamilH
10/01/2020, 10:39 AMmain
function inside jvmMain
to test the library I’m working on, but when I’m trying to run main function it returns Error: Could not find or load main class MainKt
for following function in Main.kt
fun main() {
runBlocking {
userRepository.registerUser("")
}
}
Are there any additional steps I should make to be able to use this?faogustavo
10/01/2020, 10:42 AMKamilH
10/01/2020, 10:47 AMfaogustavo
10/01/2020, 10:51 AMjvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
}
KamilH
10/01/2020, 10:57 AMmain
function is working in your case. That’s why I would like to ask you if you can choose your class (containing main) under “Edit configuration” -> “Main class”? When I’m trying to do it it’s either not finding the class or not allowing me to choose itfaogustavo
10/01/2020, 12:53 PMmbonnin
10/01/2020, 1:51 PMfun main(args: Array<String>)
KamilH
10/01/2020, 1:58 PMfaogustavo
10/02/2020, 8:40 AMKamilH
10/02/2020, 8:44 AMandroidMain
?faogustavo
10/02/2020, 8:45 AMKamilH
10/02/2020, 8:46 AMjvmMain
which is not working in my case 🙂faogustavo
10/02/2020, 8:51 AMKamilH
10/02/2020, 8:55 AMfaogustavo
10/02/2020, 12:01 PMSebastian Sellmair [JB]
10/02/2020, 1:26 PMandroidMain
wich is a source set for an Android target, right?KamilH
10/02/2020, 3:37 PMmain
function in the jvmMain
module, I’m trying to run it and I’m getting an error. Next I’m commenting-out android-related stuff in build.gradle
and trying to run main function again and now it worksfaogustavo
10/19/2020, 11:44 AMKamilH
10/19/2020, 11:52 AMfaogustavo
10/19/2020, 11:58 AM-cp $Classpath$
to the vmoptions it works too 🙂KamilH
10/19/2020, 12:04 PMfaogustavo
10/19/2020, 12:06 PMdemo/gson-memory-demo/build.gradle.kts
fileKamilH
10/19/2020, 12:13 PM