Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Image Agent Uses JAVA_HOME Instead of GRAALVM_HOME #581

Open
dnestoro opened this issue Mar 7, 2024 · 1 comment
Open

Native Image Agent Uses JAVA_HOME Instead of GRAALVM_HOME #581

dnestoro opened this issue Mar 7, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dnestoro
Copy link
Collaborator

dnestoro commented Mar 7, 2024

Is your feature request related to a problem? Please describe.

When running gradle -Pagent clean test agent picks JAVA_HOME even though GRAALVM_HOME is set. The problem is that we can set JAVA_HOME to some earlier version (lets say JDK17) and GRAALVM_HOME to the later one (e.g. JDK21), and therefor agent will generate metadata with one JDK version while the Native Image will be created with the different one (example where different metadata can be generated with different Java versions).

Describe the solution you'd like
Make native-image-agent use GRAALVM_HOME as default if possible. Only if GRAALVM_HOME is not configured, use JAVA_HOME.

Describe alternatives you've considered
At least mention in the documentation that agent uses JAVA_HOME

@dnestoro dnestoro added the enhancement New feature or request label Mar 7, 2024
@dnestoro dnestoro changed the title Native Image Agent Uses JAVA_HOME Instead of GRAALVM_HOME Native Image Agent Uses JAVA_HOME Instead of GRAALVM_HOME Mar 7, 2024
@dnestoro dnestoro self-assigned this Jul 15, 2024
@hohwille
Copy link

hohwille commented Aug 26, 2024

I am having the same issue and before finding and reading this issue I had the exact same expectation.
I would consider this as a bug that this plugin is based on JAVA_HOME rather than GRAALVM_HOME.
Even if both would share the same version there are several edge-cases where GraalVM and regular JVM (OpenJDK) do not behave the same and the maven build will fail, if you make JAVA_HOME point to GraalVM.
I want to use regular OpenJDK for Maven and for the native-maven-plugin I want to use GraalVM to build the native image.
There currently seems no way to configure this for this plugin except maybe for using the docker based approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants