question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.ClassNotFoundException: kotlin.coroutines.jvm.internal.CoroutineImpl

See original GitHub issue

my 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:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
li-xiaojuncommented, Oct 31, 2018

it works after I update IDEA kotlin plugin to 1.3 and restart IDEA,before the plugin version is 1.2.65. image

4reactions
kid1412621commented, Oct 7, 2019

got this error when using spring webflux corouter (added implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2") in gradle)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found