Build fails with Java 25

Open Beginner friendly
#91 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Start with the top-level pom.xml and its pluginManagement section, then reproduce the failure with Java 25 using mvn clean compile -X. Check the Maven compiler configuration against the issue’s proposed change, and consider the work complete when the project compiles successfully on Java 25 without the missing-symbol error.

Written by the indexing model from the issue text.

Description

Issue

Set JAVA_HOME to a Java 25 release, and the build fails:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/user/git/ChromeDevToolsClient/ChromeDevToolsBase/src/main/java/com/hubspot/chrome/devtools/base/ChromeResponseIF.java:[26,3] cannot find symbol
  symbol:   class ChromeResponseErrorBody
  location: interface com.hubspot.chrome.devtools.base.ChromeResponseIF

Fix

Add the following to the top level pom.xml in the pluginManagement:

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.14.1</version>
          <configuration>
            <compilerArgs>
              <arg>-proc:full</arg>
            </compilerArgs>
          </configuration>
        </plugin>

Investigation

If you compile with an older version of Java (21 in my case) with debug enabled, you can see a warning about annotation processing.

mvn clean compile -X

[INFO] Annotation processing is enabled because one or more processors were found
  on the class path. A future release of javac may disable annotation processing
  unless at least one processor is specified by name (-processor), or a search
  path is specified (--processor-path, --processor-module-path), or annotation
  processing is enabled explicitly (-proc:only, -proc:full).
  Use -Xlint:-options to suppress this message.
  Use -proc:none to disable annotation processing.

The default was apparently changed in JDK 23: https://inside.java/2024/06/18/quality-heads-up/

Dominant language
Java
Stars
48
Forks
19
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HubSpot/ChromeDevToolsClient

All issues in HubSpot/ChromeDevToolsClient

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.