rules_scala
rules_scala copied to clipboard
NoClassDefFoundError
Hi again,
I'm having some trouble running my code. The error java.lang.NoClassDefFoundError: java/sql/Date
The Java options I'm using are the following:
default_javac_opts = [ "-target", "1.8",
"-encoding", "UTF-8",
"-source", "1.8",
]
When I build, I get the following warning which I suspect may be related:
[Warn] bootstrap class path not set in conjunction with -source 8
If removing the source option I still get the same error at runtime however.
I'm currently building with openjdk version 1.8.0_222. Can I solve this using -Xbootclasspath? What should the value be?
Could you provide a minimal reproducible case for this? It could also because something except Java options is going wrong in the code.
[Warn] bootstrap class path not set in conjunction with -source 8
It's a warning so it may not be the root cause.
Hey @borkaehw
Sorry for the delay. I've been very busy and it took me some time to isolate the problematic part into a minimal example but here it is: https://github.com/tjarvstrand/bazel-classdef
@tjarvstrand Any solution. I'm running into the same problem. I'm trying to move our codebase from the "other" rules_scala, where we didn't have this problem.
Googling, I've found this but I'm not sure how to add this.
@subotic Eventually I gave up. I came back to the problem a few months later and didn't run into the same issue then. My suspicion is that I didn't have JAVA_HOME properly set in my environment the first time around but I can't say for sure.