You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our build uses JDK 8 to run tools and build binaries. Bazel itself and a sizeable amount of the precompiled tools are compiled using JDK 11, however, the Bazel java_tools are compiled with JDK 8 and work fine in our setup.
The remote_coverage_tools binaries, however, are precompiled using JDK 11, resulting in the following stacktrace in our setup:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/devtools/coverageoutputgenerator/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:365)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
To maintain JDK 8 compatibility (if desired), it would seem that the remote_coverage_tools should be built targeting JDK 8, or the sources made available as a part of the Bazel binary distribution
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
@nacl Bazel uses a separate JRE to run java tools like remote_coverage_tools, this is what --tool_java_language_version and --tool_java_runtime_version control. Is there any reason you also need them to be set to Java 8? In our Java 8 project, we have them set to the default of 11 with no issues.
@thirtyseven I am aware of those flags, but unfortunately we have numerous other java tools that are untested with Java 11. I agree that it will probably be fine, but if anything does come up it may become difficult to address the problems in a timely manner, as the people who might need to be involved have their own priorities/timetables/etc.
FWIW, I was able to compile these tools targeting Java 8 in our private build of Bazel with no issue, and coverage reports were generated as expected.
Description of the bug:
Our build uses JDK 8 to run tools and build binaries. Bazel itself and a sizeable amount of the precompiled tools are compiled using JDK 11, however, the Bazel java_tools are compiled with JDK 8 and work fine in our setup.
The
remote_coverage_tools
binaries, however, are precompiled using JDK 11, resulting in the following stacktrace in our setup:To maintain JDK 8 compatibility (if desired), it would seem that the remote_coverage_tools should be built targeting JDK 8, or the sources made available as a part of the Bazel binary distribution
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
In Bazel itself:
bazel coverage --java_language_version=8 --tool_java_language_version=8 --java_runtime_version=8 --tool_java_runtime_version=8 //src/tools/singlejar:output_jar_simple_test
Will have this stack trace in the logs.
The build fails with JDK 8 in recent 7.0.0-pre builds due to (apparently) incompatible changes. A different example may needed for that purpose.
Which operating system are you running Bazel on?
Linux, Alma 9 (RHEL-like), arm64
What is the output of
bazel info release
?release 6.1.0rc1 (also reproduces with 6.0.0)
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: