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

protobuf-java 4.30.0 at Maven central not compatible with Java 8 #20580

Open
tkeksa opened this issue Mar 6, 2025 · 2 comments
Open

protobuf-java 4.30.0 at Maven central not compatible with Java 8 #20580

tkeksa opened this issue Mar 6, 2025 · 2 comments

Comments

@tkeksa
Copy link

tkeksa commented Mar 6, 2025

What version of protobuf and what language are you using?
Version: main/v30.0
Language: Java

What operating system (Linux, Windows, ...) and version?
Windows 10

What runtime / compiler are you using (e.g., python version or gcc version)
Java version: 1.8.0_391, vendor: Oracle Corporation

What did you do?
Build Maven project depending on com.google.protobuf:protobuf-java:4.30.0

What did you expect to see
Successful build

What did you see instead?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (default-compile) on project OurService: Compilation failure
[ERROR] /d:/Projects/our-service/src/main/java/cz/company/ucu/backOffice/intens/GrpcDeviceAbstract.java:[75,80] cannot access com.google.protobuf.MessageLite
[ERROR] bad class file: D:\m2_repository\com\google\protobuf\protobuf-java\4.30.0\protobuf-java-4.30.0.jar(com/google/protobuf/MessageLite.class)
[ERROR] class file has wrong version 55.0, should be 52.0

Anything else we should know about your project / environment
All was OK with the 4.29.3 version and no compatibility breaking changes are mentioned in release notes.

@tkeksa tkeksa added the untriaged auto added to all issues by default when created. label Mar 6, 2025
@zhangskz
Copy link
Member

zhangskz commented Mar 6, 2025

I think this is normally configured via our javacopts to rules_jvm_external's java_export when creating our release artifacts:

JAVA_RELEASE_OPTS = [
"-source 8",
"-target 8",
"-Xep:Java8ApiChecker:ERROR",
]

We recently noticed that the rules_jvm_external version we are using is no longer compatible with JDK8 which breaks our java/utils and I would guess this is likely the cause here as well. We've reached out here and will try to patch 30.x to keep it JDK 8 compatible, as we still plan to support JDK8 until ~late 2026.

@zhangskz zhangskz added java packaging & distribution 30.x and removed untriaged auto added to all issues by default when created. labels Mar 6, 2025
@zhangskz zhangskz changed the title ptotobuf-java 4.30.0 at Maven central not compatible with Java 8 protobuf-java 4.30.0 at Maven central not compatible with Java 8 Mar 6, 2025
@toddbaert
Copy link

Confirm I'm seeing this as well.

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