Class RuntimeJNIAccess

java.lang.Object
org.graalvm.nativeimage.hosted.RuntimeJNIAccess

public final class RuntimeJNIAccess extends Object
This class provides methods that can be called during native image generation to register classes, methods, and fields for JNI access at run time.
Since:
22.3
  • Method Details

    • register

      public static void register(Class<?>... classes)
      Makes the provided classes available for JNI access at run time. Needed when native code looks up Java classes via FindClass.
      Since:
      22.3
    • register

      public static void register(Executable... methods)
      Makes the provided methods available for JNI access at run time. Needed when native code looks up Java methods via GetMethodID or GetStaticMethodID.
      Since:
      22.3
    • register

      public static void register(Field... fields)
      Makes the provided fields available for JNI access at run time. Needed when native code looks up Java fields via GetFieldID or GetStaticFieldID.
      Since:
      22.3