Skip to content

Build fails with Java 25 #91

Description

@davidcockbill

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions