Skip to content

Conversation

@graalvmbot
Copy link
Collaborator

This PR add a new NI macro option that allows to build a NI-based libjvm.so implementation.

Building with native-image --macro:jvm-library provides the library in

$GRAALVM_HOME/lib/svm

This conveniently allows us to use it with -XXaltjvm=svm, e.g.

$GRAALVM_HOME/bin/java -XXaltjvm=svm -cp hello HelloWorld

The Java launcher passes any system properties or runtime image options down to libjvm.so.
I.e. java -XXaltjvm=svm -XX:+InterpreterTrace -cp ... does what you would expect and runs Crema with interpreter tracing enabled.


Additionally other related fixes are contained in this PR:

  • Provide a workaround for Crema loaded classes not being visible/callable via JNI (see GR-71358)
  • Ensure all core classes have the null-loader at image runtime (like the C++ based VM implementation classes in HotSpot)
  • Allow libjvm.so to use the system property value for java.home at runtime (needed for JRT filesystem access to $JAVA_HOME/lib/modules)
  • Use of ImageName and ImagePath (in native-image.properties) will no more cause misleading warnings in build output

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 10, 2025
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.

2 participants