Skip to content

Upgrade build to use java 25 - #8949

Merged
jack-berg merged 1 commit into
open-telemetry:mainfrom
jack-berg:build-uses-java-25
Oct 16, 2026
Merged

jack-berg merged 1 commit into
open-telemetry:mainfrom
jack-berg:build-uses-java-25

Conversation

@jack-berg

Copy link
Copy Markdown
Member

Update the build to use java 25 (latest LTS) instead of java 21.

There's a strange interaction between java 25 javac, the --release 8 configuration to build java 8 compatible jars, and the guava-beta-checker which makes sure we don't use guava APIs annotated as beta in our source. Its annotation-name lookup triggers java 25 to resolve JSpecify's @NullMarked annotation, including its @Target(MODULE) declaration. Because ElementType.MODULE does not exist in the java 8 API view, javac emits warning: unknown enum constant ElementType.MODULE which causes the build to fail because we set -Werror.

The solution is to:

  • Migrate away from guava in published source code
  • This allows us to safely remove guava-beta-checker, since we eliminate the chance of accidentally using beta APIs and thus exposing users to errors at runtime when those APIs change
  • Add a test to programmatically verify that our published jars don't call guava directly. (Transitive dependencies like grpc may still call guava but then its on them to make sure that they don't leverage beta APIs, and this has always been the case)

@jack-berg
jack-berg requested a review from a team as a code owner October 14, 2026 18:10
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-16 14:00 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.66%. Comparing base (63150e0) to head (d145420).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ensusshim/OpenTelemetryNoRecordEventsSpanImpl.java 90.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8949      +/-   ##
============================================
+ Coverage     90.61%   90.66%   +0.04%     
- Complexity    10882    10889       +7     
============================================
  Files          1015     1015              
  Lines         29731    29736       +5     
  Branches       3876     3877       +1     
============================================
+ Hits          26942    26959      +17     
+ Misses         1872     1860      -12     
  Partials        917      917              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jack-berg
jack-berg merged commit e7e3c7e into open-telemetry:main Oct 16, 2026
34 checks passed
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

Successfully merging this pull request may close these issues.

2 participants