Skip to content

Conversation

Copy link

Copilot AI commented Jan 1, 2026

The project fails to compile on Java 17 due to two removed JDK APIs: Nashorn (removed in Java 15) and Java EE annotations (removed in Java 11).

Changes

Removed Nashorn internal API usage

  • ClientVersion.java: Deleted jdk.nashorn.internal.ir.annotations.@Immutable import and annotation
  • The Nashorn @Immutable annotation was for JavaScript engine internals, not general Java immutability

Added javax.annotation-api dependency

  • tars-spring-cloud-starter/pom.xml: Added javax.annotation-api:1.3.2 dependency
  • Required for @PostConstruct annotation used in TarsEurekaInstance.java
  • Version managed via property for consistency with existing dependencies
<properties>
    <javax-annotation-api.version>1.3.2</javax-annotation-api.version>
</properties>

<dependencies>
    <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>${javax-annotation-api.version}</version>
    </dependency>
</dependencies>

All 19 modules now compile successfully on Java 17.

Original prompt

看看当前的编译是否有问题


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 1, 2026 05:52
Co-authored-by: TimmyYu <1688061+TimmyYu@users.noreply.github.com>
Co-authored-by: TimmyYu <1688061+TimmyYu@users.noreply.github.com>
Copilot AI changed the title [WIP] Check for issues in current compilation Fix Java 17 compilation errors from removed JDK APIs Jan 1, 2026
Copilot AI requested a review from TimmyYu January 1, 2026 05:55
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