Skip to content

[aot repositories] refresh AOT metadata fails when terminal process has different JVM #1813

Open

Description

@martinlippert

Clicking on the Refresh AOT metadata code lens causes a build to be executed on the terminal, but that fails if the project uses a more recent JDK than what is being used by default in the terminal. In my case, I had JDK 21 set as the default in the terminal (on my macOS system in general, not specific to VSCode), but the project was configured to use Java 25. As a result, the build to refresh the AOT metadata failed.

We maybe need to use the project configuration to at least check whether the JDK that the terminal uses is compatible with what the project requires.

Not surf through whether we can go one step further and identify the correct JDK to use to run the build. Maybe we could infer that from the JDK-related classpath entries from the project.

Activity

  1. added this to the 5.2.0.RELEASE milestone on Feb 27, 2026
  2. BoykoAlex commented on Apr 2, 2026

    @BoykoAlex
    Contributor

    Is this in Eclipse or VSCode? It seems that eclipse would use the java configured for the project when it is running the maven goal command...

    Image

    If this is VSCode... i think we can do something about that...

  3. BoykoAlex commented on Apr 21, 2026

    @BoykoAlex
    Contributor

    It looks like VSCode maven/gradle hits a blocker... Even if I pass proper environment variables to the terminal it'd still take the java home from the rc file (bash/zsh). Unless rc files set java home conditionally (or not set at all) this won't work.
    Eclipse on the other hand works without any problems as the launch config sets the proper JVM already.

  4. martinlippert commented on Aug 13, 2026

    @martinlippert
    MemberAuthor

    I think this is the related issue on the VSCode maven side: microsoft/vscode-maven#1179

  5. martinlippert commented on Aug 26, 2026

    @martinlippert
    MemberAuthor

    Looks like the support for Maven in VSCode is done (microsoft/vscode-maven#1179).
    Support for Gradle in VSCode is next, right? (cc @BoykoAlex )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: vscodetheme: spring-data-supporttype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions