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

JMX Exporter Jar Incompatibility: Current Release Not Supports Java 8 #1117

Closed
simonhgao opened this issue Jan 14, 2025 · 6 comments
Closed

Comments

@simonhgao
Copy link

simonhgao commented Jan 14, 2025

I encountered the following error while using the JMX Exporter:

java.lang.UnsupportedClassVersionError: com/linkedin/kafka/cruisecontrol/metricsreporter/CruiseControlMetricsReporter 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: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:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.apache.kafka.common.utils.Utils.loadClass(Utils.java:416)
	at org.apache.kafka.common.utils.Utils.newInstance(Utils.java:405)
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:390)
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:474)
	at kafka.server.DynamicMetricsReporters.createReporters(DynamicBrokerConfig.scala:799)

This error indicates that the current JMX Exporter Jar only supports Java 11 (class file version 55.0) and is not compatible with older Java runtime versions (e.g., Java 8, class file version 52.0).

After upgrading to Java 11, the issue was resolved and everything started up normally.

I suggest updating the release documentation to clearly state this version limitation so that users can better configure their environments and avoid similar compatibility issues.

Thank you!

@fstab
Copy link
Member

fstab commented Jan 14, 2025

This must be a bug in our build pipeline. The JAR should be compatible with Java 8. Thanks for reporting!

@simonhgao simonhgao changed the title JMX Exporter Jar Incompatibility: Current Release Only Supports Java 11 JMX Exporter Jar Incompatibility: Current Release Not Supports Java 8 Jan 14, 2025
@dhoard dhoard self-assigned this Jan 14, 2025
@dhoard
Copy link
Collaborator

dhoard commented Jan 14, 2025

@simonhgao the class com/linkedin/kafka/cruisecontrol/metricsreporter/CruiseControlMetricsReporter is from the Cruise Control project (https://github.com/linkedin/cruise-control) which requires Java 11.

The JMX Exporter supports Java 8. It is tested on...

alibabadragonwell/dragonwell:8
amazoncorretto:8
antublue/openlogic-openjdk:8
azul/zulu-openjdk:8
azul/prime:8
bellsoft/liberica-openjdk-debian:8
bitnami/java:1.8
eclipse-temurin:8
eclipse-temurin:8-alpine
ghcr.io/graalvm/jdk:java8
ibmjava:8
ibm-semeru-runtimes:open-8-jdk-focal
konajdk/konajdk:8
mcr.microsoft.com/openjdk/jdk:8-mariner
openjdk:8
registry.access.redhat.com/ubi8/openjdk-8-runtime:latest

@simonhgao
Copy link
Author

My Kafka was previously running in a Java 8 environment, but after adding the Java agent, it reports an error. What should I do? Should I disable this reporter?

@dhoard
Copy link
Collaborator

dhoard commented Jan 17, 2025

Are you seeing the same exception?
What version of Kafka?

The Cruise Control project (https://github.com/linkedin/cruise-control) requires Java 11

@simonhgao
Copy link
Author

simonhgao commented Jan 17, 2025

The version of kafka is kafka_2.13-2.8.2.

@simonhgao
Copy link
Author

Someone else installed the CruiseControl library on this cluster, which caused this bug when starting the JMX exporter. Removing it resolved the issue. Thanks everyone for the help.

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

No branches or pull requests

3 participants