Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError on Java 11 #300

Open
breandan opened this issue Jul 24, 2022 · 1 comment
Open

NoClassDefFoundError on Java 11 #300

breandan opened this issue Jul 24, 2022 · 1 comment

Comments

@breandan
Copy link

I recently tried upgrading from JVM version 1.8 to 11 by setting kotlinOptions.jvmTarget = "11", however I encountered the following error when using this library:

    java.lang.NoClassDefFoundError: org/jetbrains/kotlin/cli/jvm/plugins/ServiceLoaderLite
        at com.tschuchort.compiletesting.AbstractKotlinCompilation.getResourcesPath(AbstractKotlinCompilation.kt:219)
        at com.tschuchort.compiletesting.AbstractKotlinCompilation.compileKotlin(AbstractKotlinCompilation.kt:194)
        at com.tschuchort.compiletesting.KotlinCompilation.compileJvmKotlin(KotlinCompilation.kt:488)
        at com.tschuchort.compiletesting.KotlinCompilation.compile(KotlinCompilation.kt:664)
...

        Caused by:
        java.lang.ClassNotFoundException: org.jetbrains.kotlin.cli.jvm.plugins.ServiceLoaderLite
            at com.tschuchort.compiletesting.AbstractKotlinCompilation.getResourcesPath(AbstractKotlinCompilation.kt:219)
            ... 5 more
@tschuchortdev
Copy link
Owner

Please send the output of gradle dependencies task and gradle files for relevant modules. I tried it just now with

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
    kotlinOptions {
        jvmTarget = "11"
    }
}

and a JDK 11 and it worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants