java.lang.ClassNotFoundException: kotlin.coroutines.jvm.internal.CoroutineImpl
See original GitHub issuemy build.gradle:
buildscript {
ext.kotlin_version = '1.3.0-rc-190'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: "kotlin"
group 'com.lxj'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0-RC1'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
my code is:
fun main(args: Array<String>) {
GlobalScope.launch{
print("I am from coroutines")
}
}
the console output:
Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/coroutines/jvm/internal/CoroutineImpl
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at start.AKt.main(a.kt:13)
Caused by: java.lang.ClassNotFoundException: kotlin.coroutines.jvm.internal.CoroutineImpl
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 13 more
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
java.lang.NoClassDefFoundError: kotlin/coroutines/jvm ...
Task :common-kt:compileKotlin FAILED e: java.lang.NoClassDefFoundError: kotlin/coroutines/jvm/internal/RestrictedSuspendLambda at java.lang.ClassLoader.
Read more >java.lang.ClassNotFoundException: Didn't find class "kotlinx ...
It is using experimental references internally. Using implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-experimental-adapter: ...
Read more >NoClassDefFoundError: kotlin/coroutines/jvm/internal ...
Thread.run(Thread.java:844) Caused by: java.lang.NoClassDefFoundError: kotlin/coroutines/jvm/internal/RestrictedSuspendLambda at ...
Read more >kotlinx-coroutines-core-jvm : 1.6.0-RC - Maven Central
kotlinx-coroutines-core - Coroutines support libraries for Kotlin.
Read more >Java.Lang.Noclassdeffounderror: Kotlinx/Coroutines ...
.e java.lang.noclassdeffounderror kotlin/coroutines/jvm/internal/restricted suspend lambda In this tutorial we'll be looking into Kotlin Coroutines.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it works after I update IDEA kotlin plugin to 1.3 and restart IDEA,before the plugin version is 1.2.65.
got this error when using spring webflux corouter (added
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2")
in gradle)