Skip to content

console module uses java.net.http.HttpClient (requires Java 11+) but inherits Java 1.8 compilation settings from parent POM, causing compilation errors #8178

Description

@xuxiaowei-com-cn

Check Ahead

  • I have searched the issues of this repository and believe that this is not a duplicate.

  • I am willing to try to fix this bug myself.

Ⅰ. Issue Description

The console module uses java.net.http.HttpClient (introduced in Java 11), but the module is compiled with Java 8 compatibility settings inherited from the parent POM. This causes compilation errors when running in IDEA.

Ⅱ. Describe what happened

When running the console module in IDEA, a compilation error related to java.net.http.HttpClient occurs:

Image

video

iShot_2026-07-24_13.09.05.mp4

Root Cause Analysis:

  1. java.net.http.HttpClient was added in Java 11.
    img.png
  2. The console module does not explicitly configure java.version, maven.compiler.source, or maven.compiler.target.
  3. The console module's parent is org.apache.seata:seata-parent, which also does not define these properties.
  4. org.apache.seata:seata-parent's parent is org.apache.seata:seata-build, which configures:
    <java.version>1.8</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
  5. As a result, the console module inherits Java 1.8 compile target, but the source code uses java.net.http.HttpClient which requires Java 11+.

Ⅲ. Describe what you expected to happen

The console module should compile successfully with a Java version that supports java.net.http.HttpClient (Java 11+), without compilation errors in IDEA.

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. Open the Seata project in IntelliJ IDEA.
  2. Navigate to the console module.
  3. Observe the compilation error on java.net.http.HttpClient usage — it will be flagged as unavailable because the module is configured with Java 1.8 source/target level.
  4. The error occurs because java.net.http.HttpClient is available starting from Java 11, but the inherited Maven compiler settings target Java 1.8.

Ⅴ. Anything else we need to know?

The fix is to add the following properties to console/pom.xml:

<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>

This overrides the inherited Java 1.8 setting from seata-build and aligns with the Spring Boot 4.0.6 / Spring Framework 7.0.7 baseline already used in the console module.

Ⅵ. Environment

IntelliJ IDEA 2026.2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions