You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[aot repositories] refresh AOT metadata fails when terminal process has different JVM #1813
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.
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.
Activity
BoykoAlex commentedon Apr 2, 2026
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...
If this is VSCode... i think we can do something about that...
BoykoAlex commentedon Apr 21, 2026
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.
martinlippert commentedon Aug 13, 2026
I think this is the related issue on the VSCode maven side: microsoft/vscode-maven#1179
martinlippert commentedon Aug 26, 2026
Looks like the support for Maven in VSCode is done (microsoft/vscode-maven#1179).
Support for Gradle in VSCode is next, right? (cc @BoykoAlex )