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

Exception in thread "main" java.lang.NoClassDefFoundError: dagger/internal/Preconditions with JDK 20 and 21 #1072

Open
yesudeep opened this issue Nov 13, 2023 · 0 comments
Assignees

Comments

@yesudeep
Copy link

yesudeep commented Nov 13, 2023

Hello,

When using rules_kotlin (tip) with JDK 21 and 20, I see this error:

ERROR: <foo>/lab/lang/kt/BUILD.bazel:140:12: KotlinCompile //lab/lang/kt:types_test_kt_ { kt: 1, java: 0, srcjars: 0 } for darwin_arm64 failed: Worker process did not return a WorkResponse:

---8<---8<--- Start of log, file at /Volumes/dumroo/.cache/bazel/7d62ec18ea2c2975e10db310a8227229/bazel-workers/worker-11-KotlinCompile.log ---8<---8<---
Exception in thread "main" java.lang.NoClassDefFoundError: dagger/internal/Preconditions
        at io.bazel.kotlin.builder.DaggerKotlinBuilderComponent$Builder.toolchain(DaggerKotlinBuilderComponent.java:43)
        at io.bazel.kotlin.builder.DaggerKotlinBuilderComponent$Builder.toolchain(DaggerKotlinBuilderComponent.java:38)
        at io.bazel.kotlin.builder.cmd.Build$main$1.invoke(Build.kt:33)
        at io.bazel.kotlin.builder.cmd.Build$main$1.invoke(Build.kt:29)
        at io.bazel.worker.Worker$Companion.from(Worker.kt:31)
        at io.bazel.kotlin.builder.cmd.Build.main(Build.kt:29)
Caused by: java.lang.ClassNotFoundException: dagger.internal.Preconditions
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        ... 6 more
---8<---8<--- End of log ---8<---8<---
INFO: Elapsed time: 119.046s, Critical Path: 86.61s
INFO: 961 processes: 215 internal, 654 darwin-sandbox, 5 local, 87 worker.
ERROR: Build did NOT complete successfully

This error does not occur with JDK 17. Not sure why that is the case though.

@restingbull restingbull self-assigned this Nov 17, 2023
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