Skip to content

Compilation errors with Java 24 #187

@robin-crazygames

Description

@robin-crazygames

Following the instructions from the readme using JDK 24

java 24.0.2 2025-07-15
Java(TM) SE Runtime Environment (build 24.0.2+12-54)
Java HotSpot(TM) 64-Bit Server VM (build 24.0.2+12-54, mixed mode, sharing)

and Maven version:

mvn --version
Apache Maven 3.9.11 (3e54c93a704957b63ee3494413a2b544fd3d825b)
Maven home: /home/robin/.sdkman/candidates/maven/current
Java version: 24.0.2, vendor: Oracle Corporation, runtime: /home/robin/.sdkman/candidates/java/24.0.2-oracle
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.11.0-29-generic", arch: "amd64", family: "unix"

Running

mvn clean package

results in a ton of errors during the compilation step:

 
[INFO] --- resources:3.3.1:resources (default-resources) @ prebid-cache ---
[INFO] Copying 6 resources from src/main/resources to target/classes
[INFO] 
[INFO] --- compiler:3.11.0:compile (default-compile) @ prebid-cache ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 66 source files with javac [debug release 21] to target/classes
[INFO] /tmp/prebid-cache-java/src/main/java/org/prebid/cache/routers/ApiRouter.java: Some input files use or override a deprecated API.
[INFO] /tmp/prebid-cache-java/src/main/java/org/prebid/cache/routers/ApiRouter.java: Recompile with -Xlint:deprecation for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /tmp/prebid-cache-java/src/main/java/org/prebid/cache/handlers/storage/GetStorageHandler.java:[44,75] cannot find symbol
  symbol:   method getPayload()
  location: variable value of type org.prebid.cache.model.PayloadWrapper
[ERROR] /tmp/prebid-cache-java/src/main/java/org/prebid/cache/handlers/storage/GetStorageHandler.java:[46,31] incompatible types: reactor.core.publisher.Mono<java.lang.Object> cannot be converted to reactor.core.publisher.Mono<org.springframework.web.reactive.function.server.ServerResponse>

Compare that to the same step when running with JDK 21, and I'm fairly certain that it is because annotating processing gets skipped under JDK24:

[INFO] --- compiler:3.11.0:compile (default-compile) @ prebid-cache ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 66 source files with javac [debug release 21] to target/classes
[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.

Note how the "Annotation processing is enabled" is not mentioned under JDK24

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions