Skip to content

Prefer GraalVM's Java when running with agent#833

Open
vjovanov wants to merge 3 commits intomasterfrom
vj/GH-581-fix-agent-java-home
Open

Prefer GraalVM's Java when running with agent#833
vjovanov wants to merge 3 commits intomasterfrom
vj/GH-581-fix-agent-java-home

Conversation

@vjovanov
Copy link
Copy Markdown
Member

@vjovanov vjovanov commented Feb 5, 2026

Fixes #581.

Summary

  • Prefer the GraalVM Java executable from GRAALVM_HOME or JAVA_HOME when running tasks instrumented with the native-image-agent.
  • Set a matching javaLauncher for Test and JavaExec tasks so Gradle 9 does not reject a mismatch between executable and javaLauncher.
  • Keep the executable override as a fallback for other JavaForkOptions implementations.
  • Add functional coverage for the agent-instrumented run task using GraalVM Java.

Validation

  • ./gradlew :native-gradle-plugin:functionalTest -DgradleVersion=9.0.0 --tests org.graalvm.buildtools.gradle.JavaApplicationWithAgentFunctionalTest --fail-fast
  • ./gradlew :native-gradle-plugin:configCacheFunctionalTest -DgradleVersion=9.0.0 --tests org.graalvm.buildtools.gradle.JavaApplicationWithAgentFunctionalTest --fail-fast
  • ./gradlew :native-gradle-plugin:test :native-gradle-plugin:inspections
  • git diff --check

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 5, 2026
@vjovanov vjovanov force-pushed the vj/GH-581-fix-agent-java-home branch 2 times, most recently from d31fd07 to 0a1299c Compare May 3, 2026 09:32
@vjovanov vjovanov requested review from fniephaus and jormundur00 and removed request for fniephaus May 3, 2026 10:10
@vjovanov vjovanov force-pushed the vj/GH-581-fix-agent-java-home branch from 0a1299c to 06fa024 Compare May 3, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native Image Agent Uses JAVA_HOME Instead of GRAALVM_HOME

1 participant