# ⬢ nativeimage 25.6.0-elide.4 Every page: [llms.txt](llms.txt), or all in one file: [llms-full.txt](llms-full.txt) API reference for nativeimage. ## Packages - [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md): This package contains annotations that configure the substitution mechanism of GraalVM Native Image. - [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md): The GraalVM SDK Native Image API allows to customize the native image generation, i.e., the ahead-of-time compilation of Java code to standalone executables. - [`org.graalvm.nativeimage.c`](org/graalvm/nativeimage/c/index.md): This package and its sub-packages provide a fast and lightweight interface between Java code and C code. - [`org.graalvm.nativeimage.c.constant`](org/graalvm/nativeimage/c/constant/index.md): This package provides parts of the Java / C interface that are related to C constants. - [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md): This package provides parts of the Java / C interface that are related to C functions. - [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md): This package provides parts of the Java / C interface that are related to C structures. - [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md): This package provides parts of the Java / C interface that are related to standard C pointer types, as well as utility functions to convert between Java types and C types. - [`org.graalvm.nativeimage.dynamicaccess`](org/graalvm/nativeimage/dynamicaccess/index.md): APIs for registering metadata for dynamic access at run time in Native Image: org.graalvm.nativeimage.dynamicaccess.ReflectiveAccess for reflection and serialization.org.graalvm.nativeimage.dynamicaccess.ResourceAccess for resources.org.graalvm.nativeimage.dynamicaccess.JNIAccess for Java Native Interface (JNI) access.org.graalvm.nativeimage.dynamicaccess.ForeignAccess for foreign function access. Obtain these APIs through org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess during org.graalvm.nativeimage.hosted.Feature.afterRegistration. - [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md): The GraalVM SDK Native Image API allows to customize the native image generation, i.e., the ahead-of-time compilation of Java code to standalone executables: org.graalvm.nativeimage.hosted.Features allow clients to intercept the native image generation and run custom initialization code at various stages.org.graalvm.nativeimage.hosted.RuntimeClassInitialization is used to configure when classes are initialized.org.graalvm.nativeimage.hosted.RuntimeReflection to register classes, methods, and fields for reflection at run time. ## Types in `com.oracle.svm.core.annotate` `Alias`, `AnnotateOriginal`, `Delete`, `Inject`, `InjectAccessors`, `KeepOriginal`, `RecomputeFieldValue`, `RecomputeFieldValue.Kind`, `Substitute`, `TargetClass`, `TargetClass.AlwaysIncluded`, `TargetClass.NoClassNameProvider`, `TargetElement` ## Types in `org.graalvm.nativeimage` `AnnotationAccess`, `CurrentIsolate`, `ImageInfo`, `ImageSingletons`, `Isolate`, `IsolateThread`, `Isolates`, `Isolates.CreateIsolateParameters`, `Isolates.CreateIsolateParameters.Builder`, `Isolates.IsolateException`, `Isolates.ProtectionDomain`, `LogHandler`, `MissingForeignRegistrationError`, `MissingJNIRegistrationError`, `MissingReflectionRegistrationError`, `ObjectHandle`, `ObjectHandles`, `PinnedObject`, `Platform`, `Platform.AARCH64`, `Platform.AMD64`, `Platform.ANDROID`, `Platform.ANDROID_AARCH64`, `Platform.DARWIN`, `Platform.DARWIN_AARCH64`, `Platform.DARWIN_AMD64`, `Platform.HOSTED_ONLY`, `Platform.IOS`, `Platform.IOS_AARCH64`, `Platform.IOS_AMD64`, `Platform.LINUX`, `Platform.LINUX_AARCH64`, `Platform.LINUX_AARCH64_BASE`, `Platform.LINUX_AMD64`, `Platform.LINUX_AMD64_BASE`, `Platform.LINUX_RISCV64`, `Platform.MACOS`, `Platform.MACOS_AARCH64`, `Platform.MACOS_AMD64`, `Platform.RISCV64`, `Platform.WINDOWS`, `Platform.WINDOWS_AARCH64`, `Platform.WINDOWS_AMD64`, `Platforms`, `ProcessProperties`, `RuntimeOptions`, `RuntimeOptions.Descriptor`, `StackValue`, `Threading`, `Threading.RecurringCallback`, `Threading.RecurringCallbackAccess`, `UnmanagedMemory`, `VMRuntime` ## Types in `org.graalvm.nativeimage.c` `CContext`, `CContext.Directives`, `CHeader`, `CHeader.Header` ## Types in `org.graalvm.nativeimage.c.constant` `CConstant`, `CConstant.ValueAccess`, `CEnum`, `CEnumConstant`, `CEnumLookup`, `CEnumValue` ## Types in `org.graalvm.nativeimage.c.function` `CEntryPoint`, `CEntryPoint.AlwaysIncluded`, `CEntryPoint.Builtin`, `CEntryPoint.ExceptionHandler`, `CEntryPoint.FatalExceptionHandler`, `CEntryPoint.IsolateContext`, `CEntryPoint.IsolateThreadContext`, `CEntryPoint.NotIncludedAutomatically`, `CEntryPoint.Publish`, `CEntryPointLiteral`, `CFunction`, `CFunction.Transition`, `CFunctionPointer`, `CLibrary`, `CMacroInfo`, `CodePointer`, `InvokeCFunctionPointer`, `RelocatedPointer` ## Types in `org.graalvm.nativeimage.c.struct` `AllowNarrowingCast`, `AllowWideningCast`, `CBitfield`, `CField`, `CFieldAddress`, `CFieldOffset`, `CPointerTo`, `CStruct`, `CTypedefOfInfo`, `RawField`, `RawFieldAddress`, `RawFieldOffset`, `RawPointerTo`, `RawStructure`, `SizeOf`, `UniqueLocationIdentity` ## Types in `org.graalvm.nativeimage.c.type` `CCharPointer`, `CCharPointerPointer`, `CConst`, `CDoublePointer`, `CFloatPointer`, `CIntPointer`, `CIntPointerPointer`, `CLongPointer`, `CShortPointer`, `CTypeConversion`, `CTypeConversion.CCharPointerHolder`, `CTypeConversion.CCharPointerPointerHolder`, `CTypedef`, `CUnsigned`, `VoidPointer`, `WordPointer` ## Types in `org.graalvm.nativeimage.dynamicaccess` `AccessCondition`, `ForeignAccess`, `JNIAccess`, `ReflectiveAccess`, `ResourceAccess` ## Types in `org.graalvm.nativeimage.hosted` `Feature`, `Feature.AfterAnalysisAccess`, `Feature.AfterCompilationAccess`, `Feature.AfterHeapLayoutAccess`, `Feature.AfterImageWriteAccess`, `Feature.AfterRegistrationAccess`, `Feature.BeforeAnalysisAccess`, `Feature.BeforeCompilationAccess`, `Feature.BeforeHeapLayoutAccess`, `Feature.BeforeImageWriteAccess`, `Feature.BeforeUniverseBuildingAccess`, `Feature.CompilationAccess`, `Feature.DuringAnalysisAccess`, `Feature.DuringSetupAccess`, `Feature.FeatureAccess`, `Feature.IsInConfigurationAccess`, `Feature.OnAnalysisExitAccess`, `Feature.OnRegistrationAccess`, `Feature.QueryReachabilityAccess`, `FieldValueTransformer`, `RuntimeClassInitialization`, `RuntimeForeignAccess`, `RuntimeJNIAccess`, `RuntimeProxyCreation`, `RuntimeReflection`, `RuntimeResourceAccess`, `RuntimeSerialization`, `RuntimeSystemProperties` # ▣ com.oracle.svm.core.annotate [nativeimage](index.md) · Every page: [llms.txt](llms.txt) Package in nativeimage. Since 22.3. This package contains annotations that configure the substitution mechanism of GraalVM Native Image. Annotated classes and methods modify the behavior of the class referenced by [`com.oracle.svm.core.annotate.TargetClass`](com/oracle/svm/core/annotate/TargetClass.md). Important: this package is not part of the supported API. It exists, and is exported in the module descriptor, for compatibility reasons only. ## Annotations - [`Alias`](com/oracle/svm/core/annotate/Alias.md): Mechanism for referring to fields and methods otherwise inaccessible due to Java language access control rules. - [`AnnotateOriginal`](com/oracle/svm/core/annotate/AnnotateOriginal.md): This annotation allows to add additional annotations to existing methods but keep the implementation as it is. - [`Delete`](com/oracle/svm/core/annotate/Delete.md): Mechanism to ensures that an element is not used. - [`Inject`](com/oracle/svm/core/annotate/Inject.md): Injects the annotated field into the TargetClass. - [`InjectAccessors`](com/oracle/svm/core/annotate/InjectAccessors.md): Inject accessor methods for the field denoted using an Alias annotation. - [`KeepOriginal`](com/oracle/svm/core/annotate/KeepOriginal.md): If a class annotated with TargetClass is also annotated with Substitute, all non-substituted methods in that class are by default treated as deleted. - [`RecomputeFieldValue`](com/oracle/svm/core/annotate/RecomputeFieldValue.md): Supported API is available to replace this non-API annotation: Use BeforeAnalysisAccess.registerFieldValueTransformer. - [`Substitute`](com/oracle/svm/core/annotate/Substitute.md): When used to annotate a method, it indicates that a method declaration is intended to be a substitute for a method declaration in another class. - [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md): A class annotated with this annotation denotes a class that modifies methods of fields of another class, called the "original" class. - [`TargetElement`](com/oracle/svm/core/annotate/TargetElement.md): Specifies additional properties for an element also annotated with Alias, Delete, Substitute, AnnotateOriginal, or KeepOriginal. # @ Alias [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({METHOD, CONSTRUCTOR, FIELD}) public @interface Alias ``` Mechanism for referring to fields and methods otherwise inaccessible due to Java language access control rules. This enables VM code to directly access a private field or invoke a private method in a JDK class without using reflection. Aliases avoid the boxing/unboxing required by reflection and they type check an aliased field access or method invocation statically. The idiom for using [`Alias`](com/oracle/svm/core/annotate/Alias.md) is somewhat related to the [`Substitute`](com/oracle/svm/core/annotate/Substitute.md) annotation, but reversed; both are often used in combination. In both cases a separate class is used to declare the aliased and/or substituted methods. In the substitution case occurrences of `this` actually refer to the instance of the class being substituted. In the aliased case we pretend that the class declaring the aliased method or field is an instance of the aliasee in order to access its fields or invoke its methods. An alias is always called (method alias) or accessed (field alias), whereas a substitution method is only implemented (usually not called directly). In the body of a substitution method, aliases are often called or accessed. The element can also be annotated with [`TargetElement`](com/oracle/svm/core/annotate/TargetElement.md) to specify additional properties. See [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md) for an overview of the annotation system. When aliasing \*non-static\* inner classes the constructors are passed a hidden argument which is the outer class. When writing an @Alias for a constructor of a \*non-static\* inner classes, you have to (a) explicitly declare that parameter, and (b) supply it in the calls. # @ AnnotateOriginal [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface AnnotateOriginal ``` This annotation allows to add additional annotations to existing methods but keep the implementation as it is. The element can also be annotated with [`TargetElement`](com/oracle/svm/core/annotate/TargetElement.md) to specify additional properties. See [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md) for an overview of the annotation system. # @ Delete [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({TYPE, METHOD, CONSTRUCTOR, FIELD}) public @interface Delete ``` Mechanism to ensures that an element is not used. The element can also be annotated with [`TargetElement`](com/oracle/svm/core/annotate/TargetElement.md) to specify additional properties. See [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md) for an overview of the annotation system. ## Elements ### value() `String value() default ""`. Since 22.3. Documents the reason why the annotated element is deleted. Default: `""`. Cite: `com/oracle/svm/core/annotate/Delete.html#value()` # @ Inject [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({FIELD}) public @interface Inject ``` Injects the annotated field into the [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md). The field must not be declared static. If instances of the target class are in the image heap, the field also needs to be annotated with [`RecomputeFieldValue`](com/oracle/svm/core/annotate/RecomputeFieldValue.md) to provide a value for the injected field. # @ InjectAccessors [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({FIELD}) public @interface InjectAccessors ``` Inject accessor methods for the field denoted using an [`Alias`](com/oracle/svm/core/annotate/Alias.md) annotation. All loads and stores to the original field are redirected to accessor methods located in the class provided in the [`value`](com/oracle/svm/core/annotate/InjectAccessors.md#value%28%29) property. The class must implement the marker interface [`InjectAccessors`](com/oracle/svm/core/annotate/InjectAccessors.md). The accessor methods are static methods in that class, named either `get` / `set` or `getFoo` / `setFoo` for a field name `foo`. Depending on the kind of accessor (get / set for a static / non-static field), the accessor must have 0, 1, or 2 parameters. If the field is non-static, the first method parameter is the accessed object. The type of the parameter must be the class that declared the field. The null check on the object is performed before the accessor is called, in the same way as the null check for a regular field access. For get-accessors, the return type of the method must be the type of the field. For set-accessors, the last method parameter must be the type of the field and denotes the value stored to the field. If no set-accessor is provided, stores to the field lead to a fatal error during image generation. If no get-accessor is provided, loads of the field lead to a fatal error during image generation. The injected accessors must not access the original field. Since all field accesses use the accessors, that would lead to a recursive call of the accessors. Instead, data must be stored in either a new static field, or an [`injected`](com/oracle/svm/core/annotate/Inject.md) instance field. ## Elements ### value() `Class value()`. Since 22.3. Cite: `com/oracle/svm/core/annotate/InjectAccessors.html#value()` # @ KeepOriginal [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({METHOD, TYPE}) public @interface KeepOriginal ``` If a class annotated with [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md) is also annotated with [`Substitute`](com/oracle/svm/core/annotate/Substitute.md), all non-substituted methods in that class are by default treated as [`deleted`](com/oracle/svm/core/annotate/Delete.md). This annotation changes the behavior: A method annotated with [`KeepOriginal`](com/oracle/svm/core/annotate/KeepOriginal.md) keeps the original definition of the method. If this annotation is used to the [`* substituted`](com/oracle/svm/core/annotate/Substitute.md) type itself, then the original definition of all methods and fields in the target type are kept by default. The element can also be annotated with [`TargetElement`](com/oracle/svm/core/annotate/TargetElement.md) to specify additional properties. See [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md) for an overview of the annotation system. # @ RecomputeFieldValue [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({FIELD}) public @interface RecomputeFieldValue ``` Supported API is available to replace this non-API annotation: Use [`BeforeAnalysisAccess.registerFieldValueTransformer`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerFieldValueTransformer%28java.lang.reflect.Field,org.graalvm.nativeimage.hosted.FieldValueTransformer%29). Mechanism to change the value of a field. Normally, field values in the native image heap of the Substrate VM are just taken from the host VM. This annotation allows the field value to be intercepted and recomputed. This annotation must be used on a field also annotated with [`Alias`](com/oracle/svm/core/annotate/Alias.md) to specify the field whose value needs to be changed. ## Nested types - [`RecomputeFieldValue.Kind`](com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.md) (enum class): No description. ## Elements ### kind() `RecomputeFieldValue.Kind kind()`. Since 22.3. The kind of the recomputation performed. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.html#kind()` ### declClass() `Class declClass() default com.oracle.svm.core.annotate.RecomputeFieldValue.class`. Since 22.3. The class parameter for the recomputation. If this attribute is not specified, then the class specified by `declClassName()` is used. If neither `declClass()` nor `declClassName()` is specified, then the class specified by the `TargetClass` annotation is used. Default: `com.oracle.svm.core.annotate.RecomputeFieldValue.class`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.html#declClass()` ### declClassName() `String declClassName() default ""`. Since 22.3. The class parameter for the recomputation. If this attribute is not specified, then the class specified by `declClass()` is used. If neither `declClass()` nor `declClassName()` is specified, then the class specified by the `TargetClass` annotation is used. Default: `""`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.html#declClassName()` ### name() `String name() default ""`. Since 22.3. The name parameter for the recomputation. Default: `""`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.html#name()` ### isFinal() `boolean isFinal() default false`. Since 22.3. Treat the value as final, to enforce constant folding already during static analysis. Default: `false`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.html#isFinal()` # ≡ RecomputeFieldValue.Kind [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Enum class in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. Nested in [`RecomputeFieldValue`](com/oracle/svm/core/annotate/RecomputeFieldValue.md). ```java public enum RecomputeFieldValue.Kind ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > [`Enum`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html) > `Kind` ## Enum constants ### None `None`. Since 22.3. The initial field value is not modified. This is the default behavior when no `RecomputeFieldValue` annotation is present. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#None` ### Reset `Reset`. Since 22.3. The field is reset to the default value (null, 0, false). Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#Reset` ### NewInstance `NewInstance`. Since 22.3. The object field is set to a instance of `declClass` created by calling the default constructor. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#NewInstance` ### NewInstanceWhenNotNull `NewInstanceWhenNotNull`. Since 22.3. The object field is set to a instance of `declClass` created by calling the default constructor when the target field value is not null. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#NewInstanceWhenNotNull` ### FromAlias `FromAlias`. Since 22.3. The field is set to the value assigned to the `Alias` field. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#FromAlias` ### FieldOffset `FieldOffset`. Since 22.3. The int or long field is set to the offset of the field named [`name()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#name%28%29) of the class `declClass`, as it would be computed by `sun.misc.Unsafe.objectFieldOffset`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#FieldOffset` ### StaticFieldBase `StaticFieldBase`. Since 23.0. The static field base Object as it would be computed by `sun.misc.Unsafe.staticFieldBase(Field)`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#StaticFieldBase` ### ArrayBaseOffset `ArrayBaseOffset`. Since 22.3. The int or long field is set to the offset of the first array element of the array class `declClass`, as it would be computed by `sun.misc.Unsafe.arrayBaseOffset(Class)`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#ArrayBaseOffset` ### ArrayIndexScale `ArrayIndexScale`. Since 22.3. The int or long field is set to the element size array class `declClass`, as it would be computed by `sun.misc.Unsafe.arrayIndexScale(Class)`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#ArrayIndexScale` ### ArrayIndexShift `ArrayIndexShift`. Since 22.3. The int or long field is set to the log2 of `ArrayIndexScale`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#ArrayIndexShift` ### AtomicFieldUpdaterOffset `AtomicFieldUpdaterOffset`. Since 22.3. Special support for field offsets used by java.util.concurrent.atomic.AtomicXxxFieldUpdater. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#AtomicFieldUpdaterOffset` ### TranslateFieldOffset `TranslateFieldOffset`. Since 22.3. The field offset stored in this int or long field is updated. The original value must be a valid field offset in the hosted universe, and the new value is the field offset of the same field in the substrate universe. The field is looked up in the class `declClass`. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#TranslateFieldOffset` ### Manual `Manual`. Since 22.3. Marker value that the field is intercepted by some manual logic. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#Manual` ### Custom `Custom`. Since 22.3. Use a `FieldValueTransformer`, which is specified as the target class. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#Custom` ## Methods ### values() `public static RecomputeFieldValue.Kind[] values()`. Returns the enum constants in declaration order. Returns `RecomputeFieldValue.Kind[]`: Returns the enum constants in declaration order. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#values()` ### valueOf(String) `public static RecomputeFieldValue.Kind valueOf(String name)`. Returns the enum constant with the given name. Parameters: `name` `String`: The exact name of the enum constant. Returns `RecomputeFieldValue.Kind`: Returns the enum constant with the given name. Cite: `com/oracle/svm/core/annotate/RecomputeFieldValue.Kind.html#valueOf(java.lang.String)` ## Inherited members - From class [`Enum`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html): [`compareTo`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#compareTo%28E%29), [`describeConstable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#describeConstable%28%29), [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#equals%28java.lang.Object%29), [`getDeclaringClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#getDeclaringClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#hashCode%28%29), [`name`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#name%28%29), [`ordinal`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#ordinal%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#toString%28%29), [`valueOf`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#valueOf%28java.lang.Class,java.lang.String%29) - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # @ Substitute [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({METHOD, CONSTRUCTOR, TYPE, FIELD}) public @interface Substitute ``` When used to annotate a method, it indicates that a method declaration is intended to be a substitute for a method declaration in another class. A substitute method must be declared in a class annotated with [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md) as the [`value`](com/oracle/svm/core/annotate/TargetClass.md#value%28%29) element of that annotation specifies the class containing the method to be substituted (the *substitutee* class). The method to be substituted is determined based on a name and a list of parameter types. The name is specified by an optional [`TargetElement.name()`](com/oracle/svm/core/annotate/TargetElement.md#name%28%29) element of this annotation. If this element is not specified, then the name of the substitution method is used. The parameter types are those of the substitution method. There must never be an explicit call to a non-static method annotated with [`Substitute`](com/oracle/svm/core/annotate/Substitute.md) unless it is from another non-static method in the same class. When used to annotate a class, it indicates that the class is intended to be a full substitute for the class specified via [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md). All methods in the target class that are not substituted in the annotated class are implicitly treated as [`Delete`](com/oracle/svm/core/annotate/Delete.md)d. See [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md) for an overview of the annotation system. ## Elements ### polymorphicSignature() `boolean polymorphicSignature() default false`. Since 22.3. Default: `false`. Cite: `com/oracle/svm/core/annotate/Substitute.html#polymorphicSignature()` # @ TargetClass [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({TYPE}) public @interface TargetClass ``` A class annotated with this annotation denotes a class that modifies methods of fields of another class, called the "original" class. The original class is specified using annotation parameters: [`value`](com/oracle/svm/core/annotate/TargetClass.md#value%28%29) or [`className`](com/oracle/svm/core/annotate/TargetClass.md#className%28%29) specify the original class either as a class literal or by name, while [`classNameProvider`](com/oracle/svm/core/annotate/TargetClass.md#classNameProvider%28%29) is the most flexible approach where the class name is computed by user code. Optionally, inner classes can be specified using the [`innerClass`](com/oracle/svm/core/annotate/TargetClass.md#innerClass%28%29) property. Based on additional annotations, the original class is modified in different ways: - None of [`Delete`](com/oracle/svm/core/annotate/Delete.md) or [`Substitute`](com/oracle/svm/core/annotate/Substitute.md): the annotated class is an alias for the original class. This is the most frequently used case. All methods and fields of the annotated class must be annotated too: - [`Alias`](com/oracle/svm/core/annotate/Alias.md): The annotated method or field is an alias for the original element, i.e., the annotated element does not exist at run time. All usages of the annotated element reference the original element. For fields, the original field can be further modified using the [`RecomputeFieldValue`](com/oracle/svm/core/annotate/RecomputeFieldValue.md) and [`InjectAccessors`](com/oracle/svm/core/annotate/InjectAccessors.md) annotations (see the documentation of the annotations for details). - [`Delete`](com/oracle/svm/core/annotate/Delete.md): The annotated method or field, as well as the original element, do not exist. Any usage of them will be reported as an error. - [`Substitute`](com/oracle/svm/core/annotate/Substitute.md): The annotated method replaces the original method. - [`AnnotateOriginal`](com/oracle/svm/core/annotate/AnnotateOriginal.md): The original method remains mostly unchanged, but with one exception: all annotations on the annotated method are also present on the original method. - [`Delete`](com/oracle/svm/core/annotate/Delete.md): The annotated class, as well as the original class, do not exist. Any usage of them will be reported as an error. - [`Substitute`](com/oracle/svm/core/annotate/Substitute.md): The annotated class replaces the original class. All fields and methods of the original class are per default treated as deleted, i.e., any usage of them will be reported as an error, with the following exception: A method annotated with [`Substitute`](com/oracle/svm/core/annotate/Substitute.md) replaces the original method, i.e., calls to the original method now call the annotated method; a method annotated with [`KeepOriginal`](com/oracle/svm/core/annotate/KeepOriginal.md) keeps the original method, i.e., calls to the original method still call the original method. ## Nested types - [`TargetClass.AlwaysIncluded`](com/oracle/svm/core/annotate/TargetClass.AlwaysIncluded.md) (class): The default value for the TargetClass.onlyWith() attribute. - [`TargetClass.NoClassNameProvider`](com/oracle/svm/core/annotate/TargetClass.NoClassNameProvider.md) (interface): Marker value for classNameProvider that no class name provider should be used. ## Elements ### value() `Class value() default com.oracle.svm.core.annotate.TargetClass.class`. Since 22.3. Specifies the substitutee class using a class literal. Either `value()`, `className()` or `classNameProvider()` element can be used to specify the substitutee class. Default: `com.oracle.svm.core.annotate.TargetClass.class`. Cite: `com/oracle/svm/core/annotate/TargetClass.html#value()` ### className() `String className() default ""`. Since 22.3. Specifies the substitutee class using a class-name string. This method is provided for cases where the substitutee class is not accessible (according to Java language access control rules). Either `value()`, `className()` or `classNameProvider()` element can be used to specify the substitutee class. Default: `""`. Cite: `com/oracle/svm/core/annotate/TargetClass.html#className()` ### classNameProvider() `Class> classNameProvider() default com.oracle.svm.core.annotate.TargetClass.NoClassNameProvider.class`. Since 22.3. Specifies the substitutee class. This is the most flexible version to provide the class name to specify which class should be substituted. The [`Function.apply`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Function.html#apply%28T%29) method of the provided class can compute the class name based on system properties (like the JDK version). This annotation is the argument of the function, so the function can, e.g., build a class name that incorporates the `className()` property. Either `value()`, `className()` or `classNameProvider()` element can be used to specify the substitutee class. Default: `com.oracle.svm.core.annotate.TargetClass.NoClassNameProvider.class`. Cite: `com/oracle/svm/core/annotate/TargetClass.html#classNameProvider()` ### innerClass() `String[] innerClass() default {}`. Since 22.3. Specifies the suffix of the substitutee class name when it is an inner class. Default: `{}`. Cite: `com/oracle/svm/core/annotate/TargetClass.html#innerClass()` ### onlyWith() `Class[] onlyWith() default {com.oracle.svm.core.annotate.TargetClass.AlwaysIncluded.class}`. Since 22.3. Substitute only if all provided predicates are true (default: unconditional substitution that is always included). The classes must either implement [`BooleanSupplier`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/BooleanSupplier.html) or [`Predicate`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html)\ (the parameter for [`Predicate.test`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html#test%28T%29) is the "original" class name as a [`String`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html)). Default: `{com.oracle.svm.core.annotate.TargetClass.AlwaysIncluded.class}`. Cite: `com/oracle/svm/core/annotate/TargetClass.html#onlyWith()` # ◆ TargetClass.AlwaysIncluded [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Class in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. Nested in [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md). ```java public class TargetClass.AlwaysIncluded implements BooleanSupplier ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `AlwaysIncluded` Implements: [`BooleanSupplier`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/BooleanSupplier.html) The default value for the [`TargetClass.onlyWith()`](com/oracle/svm/core/annotate/TargetClass.md#onlyWith%28%29) attribute. ## Methods ### getAsBoolean() `public boolean getAsBoolean()`. Since 22.3. Overrides `getAsBoolean()`. Cite: `com/oracle/svm/core/annotate/TargetClass.AlwaysIncluded.html#getAsBoolean()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◇ TargetClass.NoClassNameProvider [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. Nested in [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md). ```java public interface TargetClass.NoClassNameProvider extends Function ``` Extends: [`Function`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Function.html)`<`[`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md)`, `[`String`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html)`>` Marker value for [`classNameProvider`](com/oracle/svm/core/annotate/TargetClass.md#classNameProvider%28%29) that no class name provider should be used. ## Inherited members - From interface [`Function`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Function.html): [`andThen`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Function.html#andThen%28java.util.function.Function%29), [`apply`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Function.html#apply%28T%29), [`compose`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Function.html#compose%28java.util.function.Function%29) # @ TargetElement [nativeimage](index.md) › [com.oracle.svm.core.annotate](com/oracle/svm/core/annotate/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`com.oracle.svm.core.annotate`](com/oracle/svm/core/annotate/index.md). Since 22.3. ```java @Retention(RUNTIME) @Target({METHOD, CONSTRUCTOR, FIELD}) public @interface TargetElement ``` Specifies additional properties for an element also annotated with [`Alias`](com/oracle/svm/core/annotate/Alias.md), [`Delete`](com/oracle/svm/core/annotate/Delete.md), [`Substitute`](com/oracle/svm/core/annotate/Substitute.md), [`AnnotateOriginal`](com/oracle/svm/core/annotate/AnnotateOriginal.md), or [`KeepOriginal`](com/oracle/svm/core/annotate/KeepOriginal.md). See [`TargetClass`](com/oracle/svm/core/annotate/TargetClass.md) for an overview of the annotation system. ## Fields ### CONSTRUCTOR_NAME `String CONSTRUCTOR_NAME`. Since 22.3. Constant value: `""`. Cite: `com/oracle/svm/core/annotate/TargetElement.html#CONSTRUCTOR_NAME` ## Elements ### name() `String name() default ""`. Since 22.3. The name of the field or method in the original class. If the default value is specified for this element, then the name of the annotated field or method is used. To make a reference to a constructor, use the name `CONSTRUCTOR_NAME`. Default: `""`. Cite: `com/oracle/svm/core/annotate/TargetElement.html#name()` ### onlyWith() `Class[] onlyWith() default {com.oracle.svm.core.annotate.TargetClass.AlwaysIncluded.class}`. Since 22.3. Substitute only if all provided predicates are true (default: unconditional substitution that is always included). The classes must either implement [`BooleanSupplier`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/BooleanSupplier.html) or [`Predicate`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html)\ (the parameter for [`Predicate.test`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html#test%28T%29) is the "original" class as specified by the `TargetClass` annotation, as a [`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html)). Default: `{com.oracle.svm.core.annotate.TargetClass.AlwaysIncluded.class}`. Cite: `com/oracle/svm/core/annotate/TargetElement.html#onlyWith()` # ▣ org.graalvm.nativeimage [nativeimage](index.md) · Every page: [llms.txt](llms.txt) Package in nativeimage. Since 19.0. The GraalVM SDK Native Image API allows to customize the native image generation, i.e., the ahead-of-time compilation of Java code to standalone executables. It also provides interfaces and support classes that only work in the context of a native image. ## Interfaces - [`Isolate`](org/graalvm/nativeimage/Isolate.md): Pointer to the runtime data structure for an isolate. - [`IsolateThread`](org/graalvm/nativeimage/IsolateThread.md): Pointer to the runtime data structure for a thread. - [`LogHandler`](org/graalvm/nativeimage/LogHandler.md): Low-level handler for log messages of native images. - [`ObjectHandle`](org/graalvm/nativeimage/ObjectHandle.md): The opaque representation of a handle to a Java object given out to unmanaged code. - [`ObjectHandles`](org/graalvm/nativeimage/ObjectHandles.md): Manages a set of ObjectHandles. - [`PinnedObject`](org/graalvm/nativeimage/PinnedObject.md): Holder for a pinned object, such that the object doesn't move until the pin is removed. - [`Platform`](org/graalvm/nativeimage/Platform.md): Root of the interface hierarchy for architectures, OS, and supported combinations of them. ## Classes - [`AnnotationAccess`](org/graalvm/nativeimage/AnnotationAccess.md): This class provides same-VM annotation access for AnnotatedElements owned by the current context while trying to prevent, at image build time, side-effecting changes that impact the analysis results. - [`CurrentIsolate`](org/graalvm/nativeimage/CurrentIsolate.md): Utility methods that provide access to the current isolate. - [`ImageInfo`](org/graalvm/nativeimage/ImageInfo.md): Utility class to retrieve information about the context in which code gets executed. - [`ImageSingletons`](org/graalvm/nativeimage/ImageSingletons.md): A key-value store of singleton objects. - [`Isolates`](org/graalvm/nativeimage/Isolates.md): Support for the creation, access to, and tear-down of isolates. - [`ProcessProperties`](org/graalvm/nativeimage/ProcessProperties.md): Utility class to get and set properties of the OS process at run time. - [`RuntimeOptions`](org/graalvm/nativeimage/RuntimeOptions.md): Used for manipulating options at run time. - [`StackValue`](org/graalvm/nativeimage/StackValue.md): Contains static methods for memory allocation in the stack frame. - [`Threading`](org/graalvm/nativeimage/Threading.md): Functionality related to execution in threads. - [`UnmanagedMemory`](org/graalvm/nativeimage/UnmanagedMemory.md): Contains static methods that allow allocate/free of unmanaged memory, i.e., memory that is not under the control of the garbage collector. - [`VMRuntime`](org/graalvm/nativeimage/VMRuntime.md): Used for doing VM runtime operations. ## Exceptions - [`MissingForeignRegistrationError`](org/graalvm/nativeimage/MissingForeignRegistrationError.md): This error is thrown when a query through the Foreign Function and Memory (FFM) API did not get appropriately registered at build-time. - [`MissingJNIRegistrationError`](org/graalvm/nativeimage/MissingJNIRegistrationError.md): This exception is thrown when a JNI query tries to access an element that was not registered for JNI access in the program. - [`MissingReflectionRegistrationError`](org/graalvm/nativeimage/MissingReflectionRegistrationError.md): This exception is thrown when a reflective query (such as Class.getMethod(String, Class\[\])) tries to access an element that was not registered for reflection in the program. ## Annotations - [`Platforms`](org/graalvm/nativeimage/Platforms.md): Restricts the annotated element (type, method, or field) to the specified Platform groups. # ◆ AnnotationAccess [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.3. ```java public final class AnnotationAccess ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `AnnotationAccess` This class provides same-VM annotation access for [`AnnotatedElement`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/AnnotatedElement.html)s owned by the current context while trying to prevent, at image build time, side-effecting changes that impact the analysis results. Native Image builder code querying guest-owned JVMCI elements must use its builder-to-guest annotation facade instead. The getAnnotation implementation in the JDK for Class, Field, and Method initializes the classes of all annotations present on that element, not just the class of the queried annotation. This leads to problems when not all annotation classes are present on the classpath/modulepath: querying an annotation whose class is present can fail with an exception because not all annotation classes are present. When this class's methods are called at image build time, then the minimal amount of class initialization is done: [`getAnnotation`](org/graalvm/nativeimage/AnnotationAccess.md#getAnnotation%28java.lang.reflect.AnnotatedElement,java.lang.Class%29) only initializes the queried annotation class (when the annotation is actually present and therefore instantiated); [`isAnnotationPresent`](org/graalvm/nativeimage/AnnotationAccess.md#isAnnotationPresent%28java.lang.reflect.AnnotatedElement,java.lang.Class%29) and [`getAnnotationTypes`](org/graalvm/nativeimage/AnnotationAccess.md#getAnnotationTypes%28java.lang.reflect.AnnotatedElement%29) do not initialize any classes. When methods of this class are called not at image build time, i.e., at image run time or during the execution of a Java application not involving native image, then the JDK method to query the annotation is invoked. In these cases, there is no difference to the class initialization behavior of the JDK. In a fully isolated image build, builder-owned elements are queried in the builder VM using core reflection. For those elements, these methods follow the JDK class initialization behavior; in particular, [`getAnnotationTypes`](org/graalvm/nativeimage/AnnotationAccess.md#getAnnotationTypes%28java.lang.reflect.AnnotatedElement%29) can initialize annotation interfaces. Guest and application elements retain the reduced class initialization behavior described above. Note that there is intentionally no \`getAnnotations\` method to query all annotations: all annotation classes must be initialized anyways by this method, so the JDK method can be invoke directly. In the image generator it should be generally avoided to use \`getAnnotations\`. ## Methods ### isAnnotationPresent(AnnotatedElement, Class) `public static boolean isAnnotationPresent(AnnotatedElement element, Class annotationClass)`. Since 22.3. Implementation of [`AnnotatedElement.isAnnotationPresent(Class)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/AnnotatedElement.html#isAnnotationPresent%28java.lang.Class%29). Cite: `org/graalvm/nativeimage/AnnotationAccess.html#isAnnotationPresent(java.lang.reflect.AnnotatedElement,java.lang.Class)` ### getAnnotation(AnnotatedElement, Class) `public static T getAnnotation(AnnotatedElement element, Class annotationType)`. Since 22.3. Implementation of [`AnnotatedElement.getAnnotation(Class)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/AnnotatedElement.html#getAnnotation%28java.lang.Class%29) . Cite: `org/graalvm/nativeimage/AnnotationAccess.html#getAnnotation(java.lang.reflect.AnnotatedElement,java.lang.Class)` ### getAnnotationTypes(AnnotatedElement) `public static Class[] getAnnotationTypes(AnnotatedElement element)`. Since 22.3. Implementation for retrieving all [`Annotation.annotationType()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/annotation/Annotation.html#annotationType%28%29)s for a `element`. Cite: `org/graalvm/nativeimage/AnnotationAccess.html#getAnnotationTypes(java.lang.reflect.AnnotatedElement)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ CurrentIsolate [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class CurrentIsolate ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `CurrentIsolate` Utility methods that provide access to the current isolate. ## Methods ### getIsolate() `public static Isolate getIsolate()`. Since 19.0. Returns the current isolate. Cite: `org/graalvm/nativeimage/CurrentIsolate.html#getIsolate()` ### getCurrentThread() `public static IsolateThread getCurrentThread()`. Since 19.0. Returns the current thread in the current isolate. Cite: `org/graalvm/nativeimage/CurrentIsolate.html#getCurrentThread()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ ImageInfo [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class ImageInfo ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `ImageInfo` Utility class to retrieve information about the context in which code gets executed. The provided string constants are part of the API and guaranteed to remain unchanged in future versions. This allows to use [`System.getProperty(String)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/System.html#getProperty%28java.lang.String%29) directly with the string literals defined here thus eliminating the need to depend on this class. ## Fields ### PROPERTY_NATIVE_IMAGE_PREFIX `public static final String PROPERTY_NATIVE_IMAGE_PREFIX`. Since 25.0. Holds a name that is a prefix for all native-image properties. Constant value: `"org.graalvm.nativeimage."`. Cite: `org/graalvm/nativeimage/ImageInfo.html#PROPERTY_NATIVE_IMAGE_PREFIX` ### PROPERTY_IMAGE_CODE_KEY `public static final String PROPERTY_IMAGE_CODE_KEY`. Since 19.0. Holds the string that is the name of the system property providing information about the context in which code is currently executing. If the property returns the string given by `PROPERTY_IMAGE_CODE_VALUE_BUILDTIME` the code is executing in the context of image building (e.g. in a static initializer of a class that will be contained in the image). If the property returns the string given by `PROPERTY_IMAGE_CODE_VALUE_RUNTIME` the code is executing at image runtime. Otherwise, the property is not set. Constant value: `"org.graalvm.nativeimage.imagecode"`. Cite: `org/graalvm/nativeimage/ImageInfo.html#PROPERTY_IMAGE_CODE_KEY` ### PROPERTY_IMAGE_CODE_VALUE_BUILDTIME `public static final String PROPERTY_IMAGE_CODE_VALUE_BUILDTIME`. Since 19.0. Holds the string that will be returned by the system property for `ImageInfo.PROPERTY_IMAGE_CODE_KEY` if code is executing in the context of image building (e.g. in a static initializer of class that will be contained in the image). Constant value: `"buildtime"`. Cite: `org/graalvm/nativeimage/ImageInfo.html#PROPERTY_IMAGE_CODE_VALUE_BUILDTIME` ### PROPERTY_IMAGE_CODE_VALUE_RUNTIME `public static final String PROPERTY_IMAGE_CODE_VALUE_RUNTIME`. Since 19.0. Holds the string that will be returned by the system property for `ImageInfo.PROPERTY_IMAGE_CODE_KEY` if code is executing at image runtime. Constant value: `"runtime"`. Cite: `org/graalvm/nativeimage/ImageInfo.html#PROPERTY_IMAGE_CODE_VALUE_RUNTIME` ### PROPERTY_IMAGE_KIND_KEY `public static final String PROPERTY_IMAGE_KIND_KEY`. Since 19.0. Name of the system property that holds if this image is built as a shared library or an executable. If the property is `PROPERTY_IMAGE_KIND_VALUE_EXECUTABLE` the image is built as an executable. If the property is `PROPERTY_IMAGE_KIND_VALUE_SHARED_LIBRARY` the image is built as a shared library. Constant value: `"org.graalvm.nativeimage.kind"`. Cite: `org/graalvm/nativeimage/ImageInfo.html#PROPERTY_IMAGE_KIND_KEY` ### PROPERTY_IMAGE_KIND_VALUE_SHARED_LIBRARY `public static final String PROPERTY_IMAGE_KIND_VALUE_SHARED_LIBRARY`. Since 19.0. Holds the string that will be returned by the system property for `ImageInfo.PROPERTY_IMAGE_KIND_KEY` if image is a shared library. Constant value: `"shared"`. Cite: `org/graalvm/nativeimage/ImageInfo.html#PROPERTY_IMAGE_KIND_VALUE_SHARED_LIBRARY` ### PROPERTY_IMAGE_KIND_VALUE_EXECUTABLE `public static final String PROPERTY_IMAGE_KIND_VALUE_EXECUTABLE`. Since 19.0. Holds the string that will be returned by the system property for `ImageInfo.PROPERTY_IMAGE_KIND_KEY` if image is an executable. Constant value: `"executable"`. Cite: `org/graalvm/nativeimage/ImageInfo.html#PROPERTY_IMAGE_KIND_VALUE_EXECUTABLE` ## Methods ### inImageCode() `public static boolean inImageCode()`. Since 19.0. Returns true if (at the time of the call) code is executing in the context of image building or during image runtime, else false. This method will be const-folded so that it can be used to hide parts of an application that only work when running on the JVM. For example: `if (!ImageInfo.inImageCode()) { ... JVM specific code here ... }`. Cite: `org/graalvm/nativeimage/ImageInfo.html#inImageCode()` ### inImageRuntimeCode() `public static boolean inImageRuntimeCode()`. Since 19.0. Returns true if (at the time of the call) code is executing at image runtime. This method will be const-folded. It can be used to hide parts of an application that only work when running as native image. Cite: `org/graalvm/nativeimage/ImageInfo.html#inImageRuntimeCode()` ### inImageBuildtimeCode() `public static boolean inImageBuildtimeCode()`. Since 19.0. Returns true if (at the time of the call) code is executing in the context of image building (e.g. in a static initializer of class that will be contained in the image). Cite: `org/graalvm/nativeimage/ImageInfo.html#inImageBuildtimeCode()` ### isExecutable() `public static boolean isExecutable()`. Since 19.0. Returns true if the image is built as an executable. Cite: `org/graalvm/nativeimage/ImageInfo.html#isExecutable()` ### isSharedLibrary() `public static boolean isSharedLibrary()`. Since 19.0. Returns true if the image is build as a shared library. Cite: `org/graalvm/nativeimage/ImageInfo.html#isSharedLibrary()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ ImageSingletons [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class ImageSingletons ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `ImageSingletons` A key-value store of singleton objects. The registry is populated during native image generation (no changes are allowed at run time); it is queried both during native image generation and at run time. The key is a [`class or interface`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html), the value is an instance that extends that class. When accessing the registry at run time, the key must be a compile time constant. The [`lookup`](org/graalvm/nativeimage/ImageSingletons.md#lookup%28java.lang.Class%29) is performed during native image generation, and the resulting value is put into the compiled code as a literal constant. Therefore, the actual map that stores the key-value data is not necessary at run time, and there is no lookup overhead at run time. [`ImageSingletons`](org/graalvm/nativeimage/ImageSingletons.md) avoids static fields: instead of filling a static field during native image generation and accessing it at run time, the value is put into the [`ImageSingletons`](org/graalvm/nativeimage/ImageSingletons.md). Usually, that happens in one of the early initialization methods of a [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ## Methods ### add(Class, T) `public static void add(Class key, T value)`. Since 19.0. Add a singleton to the registry. The key must be unique, i.e., no value must have been registered with the given class before. Cite: `org/graalvm/nativeimage/ImageSingletons.html#add(java.lang.Class,T)` ### lookup(Class) `public static T lookup(Class key)`. Since 19.0. Lookup a singleton in the registry. The key must be a compile time constant, so that the call to this method can be replaced with the constant configuration objects. The key must have been `added` before, i.e., the result is guaranteed to be non- `null`. Cite: `org/graalvm/nativeimage/ImageSingletons.html#lookup(java.lang.Class)` ### contains(Class) `public static boolean contains(Class key)`. Since 19.0. Checks if a singleton is in the registry. The key must be a compile time constant, so that the call to this method can be replaced with the constant `true` or `false`. The method returns `false` since 19.3.0 when not used in the context of a native image. As such it is safe to write: and let such code run fine in the context of `native image` as well as outside of it. Cite: `org/graalvm/nativeimage/ImageSingletons.html#contains(java.lang.Class)` ```java if (ImageSingletons.contains(MyService.class)) { MyService myService = ImageSingletons.lookup(MyService.class); myService.useMyService(); } ``` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◇ Isolate [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public interface Isolate extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) Pointer to the runtime data structure for an isolate. The size and actual layout of the data structure is unspecified, client code must not make any assumptions about it. ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◇ IsolateThread [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public interface IsolateThread extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) Pointer to the runtime data structure for a thread. The size and actual layout of the data structure is unspecified, client code must not make any assumptions about it. The [`IsolateThread`](org/graalvm/nativeimage/IsolateThread.md) points to a thread-local data structure. Therefore, the pointer must not be shared between threads. ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◆ Isolates [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class Isolates ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `Isolates` Support for the creation, access to, and tear-down of isolates. ## Nested types - [`Isolates.CreateIsolateParameters`](org/graalvm/nativeimage/Isolates.CreateIsolateParameters.md) (class): Parameters for the creation of an isolate. - [`Isolates.IsolateException`](org/graalvm/nativeimage/Isolates.IsolateException.md) (exception): An exception thrown in the context of managing isolates. - [`Isolates.ProtectionDomain`](org/graalvm/nativeimage/Isolates.ProtectionDomain.md) (interface): Identifies a protection domain for an isolate. ## Methods ### createIsolate(Isolates.CreateIsolateParameters) `public static IsolateThread createIsolate(Isolates.CreateIsolateParameters parameters) throws Isolates.IsolateException`. Since 19.0. Creates a new isolate with the passed parameters. On success, the current thread is attached to the created isolate, and a pointer to its associated `IsolateThread` structure is returned. Parameters: `parameters` `Isolates.CreateIsolateParameters`: Parameters for the creation of the isolate. Returns `IsolateThread`: A pointer to the structure that represents the current thread in the new isolate. Throws: `Isolates.IsolateException`: on error. Cite: `org/graalvm/nativeimage/Isolates.html#createIsolate(org.graalvm.nativeimage.Isolates.CreateIsolateParameters)` ### attachCurrentThread(Isolate) `public static IsolateThread attachCurrentThread(Isolate isolate) throws Isolates.IsolateException`. Since 19.0. Attaches the current thread to the passed isolate. If the thread has already been attached, the call provides the thread's existing isolate thread structure. Parameters: `isolate` `Isolate`: The isolate to which to attach the current thread. Returns `IsolateThread`: A pointer to the structure representing the newly attached isolate thread. Throws: `Isolates.IsolateException`: on error. Cite: `org/graalvm/nativeimage/Isolates.html#attachCurrentThread(org.graalvm.nativeimage.Isolate)` ### getCurrentThread(Isolate) `public static IsolateThread getCurrentThread(Isolate isolate) throws Isolates.IsolateException`. Since 19.0. Given an isolate to which the current thread is attached, returns the address of the thread's associated isolate thread structure. If the current thread is not attached to the passed isolate, returns `null`. Parameters: `isolate` `Isolate`: The isolate for which to retrieve the current thread's corresponding structure. Returns `IsolateThread`: A pointer to the current thread's structure in the specified isolate or `null` if the thread is not attached to that isolate. Throws: `Isolates.IsolateException`: on error. Cite: `org/graalvm/nativeimage/Isolates.html#getCurrentThread(org.graalvm.nativeimage.Isolate)` ### getIsolate(IsolateThread) `public static Isolate getIsolate(IsolateThread thread) throws Isolates.IsolateException`. Since 19.0. Given an isolate thread structure, determines to which isolate it belongs and returns the address of the isolate structure. May return `null` if the specified isolate thread structure is no longer valid. Parameters: `thread` `IsolateThread`: The isolate thread for which to retrieve the isolate. Returns `Isolate`: A pointer to the isolate, or `null`. Throws: `Isolates.IsolateException`: on error. Cite: `org/graalvm/nativeimage/Isolates.html#getIsolate(org.graalvm.nativeimage.IsolateThread)` ### detachThread(IsolateThread) `public static void detachThread(IsolateThread thread) throws Isolates.IsolateException`. Since 19.0. Detaches the passed isolate thread from its isolate and discards any state or context that is associated with it. At the time of the call, no code may still be executing in the isolate thread's context. The passed pointer is no longer valid after the method returns. Parameters: `thread` `IsolateThread`: The isolate thread to detach from its isolate. Throws: `Isolates.IsolateException`: on error. Cite: `org/graalvm/nativeimage/Isolates.html#detachThread(org.graalvm.nativeimage.IsolateThread)` ### tearDownIsolate(IsolateThread) `public static void tearDownIsolate(IsolateThread thread) throws Isolates.IsolateException`. Since 19.0. Tears down an isolate. Given an `IsolateThread` for the current thread which must be attached to the isolate to be torn down, waits for any other attached threads to detach from the isolate, then discards the isolate's objects, threads, and any other state or context that is associated with it. The passed pointer is no longer valid after the method returns. Parameters: `thread` `IsolateThread`: `IsolateThread` of the current thread that is attached to the isolate which is to be torn down. Throws: `Isolates.IsolateException`: on error. Cite: `org/graalvm/nativeimage/Isolates.html#tearDownIsolate(org.graalvm.nativeimage.IsolateThread)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ Isolates.CreateIsolateParameters [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Isolates`](org/graalvm/nativeimage/Isolates.md). ```java public static final class Isolates.CreateIsolateParameters ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `CreateIsolateParameters` Parameters for the creation of an isolate. **See also** - [`CreateIsolateParameters.Builder`](org/graalvm/nativeimage/Isolates.CreateIsolateParameters.Builder.md) ## Nested types - [`Isolates.CreateIsolateParameters.Builder`](org/graalvm/nativeimage/Isolates.CreateIsolateParameters.Builder.md) (class): Builder for a CreateIsolateParameters instance. ## Methods ### getDefault() `public static Isolates.CreateIsolateParameters getDefault()`. Since 19.0. Returns a `CreateIsolateParameters` with all default values. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.html#getDefault()` ### getReservedAddressSpaceSize() `public UnsignedWord getReservedAddressSpaceSize()`. Since 19.0. Returns the size in bytes for the reserved virtual address space of the new isolate. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.html#getReservedAddressSpaceSize()` ### getAuxiliaryImagePath() `public String getAuxiliaryImagePath()`. Since 20.1. Returns the file path to an auxiliary image which should be loaded in addition to the main image, or `null` if no such image should be loaded. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.html#getAuxiliaryImagePath()` ### getAuxiliaryImageReservedSpaceSize() `public UnsignedWord getAuxiliaryImageReservedSpaceSize()`. Since 20.1. Returns the size in bytes of an address space to reserve for loading an auxiliary image in addition to the main image, or 0 if no space should be reserved. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.html#getAuxiliaryImageReservedSpaceSize()` ### getArguments() `public List getArguments()`. Since 22.1. Returns the list of additional isolate arguments. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.html#getArguments()` ### getProtectionDomain() `public Isolates.ProtectionDomain getProtectionDomain()`. Since 22.1. Returns the memory protection domain to be used for an isolate. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.html#getProtectionDomain()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ Isolates.CreateIsolateParameters.Builder [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Isolates.CreateIsolateParameters`](org/graalvm/nativeimage/Isolates.CreateIsolateParameters.md). ```java public static final class Isolates.CreateIsolateParameters.Builder ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `Builder` Builder for a [`CreateIsolateParameters`](org/graalvm/nativeimage/Isolates.CreateIsolateParameters.md) instance. ## Constructors ### Builder() `public Builder()`. Since 19.0. Creates a new builder with default values. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.Builder.html#()` ## Methods ### reservedAddressSpaceSize(UnsignedWord) `public Isolates.CreateIsolateParameters.Builder reservedAddressSpaceSize(UnsignedWord size)`. Since 19.0. Sets the size in bytes for the reserved virtual address space of the new isolate. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.Builder.html#reservedAddressSpaceSize(org.graalvm.word.UnsignedWord)` ### auxiliaryImagePath(String) `public Isolates.CreateIsolateParameters.Builder auxiliaryImagePath(String filePath)`. Since 20.1. Sets the file path to an auxiliary image which should be loaded in addition to the main image, or `null` if no such image should be loaded. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.Builder.html#auxiliaryImagePath(java.lang.String)` ### auxiliaryImageReservedSpaceSize(UnsignedWord) `public Isolates.CreateIsolateParameters.Builder auxiliaryImageReservedSpaceSize(UnsignedWord size)`. Since 20.1. Sets the size in bytes of an address space to reserve for loading an auxiliary image in addition to the main image, or 0 if no space should be reserved. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.Builder.html#auxiliaryImageReservedSpaceSize(org.graalvm.word.UnsignedWord)` ### appendArgument(String) `public Isolates.CreateIsolateParameters.Builder appendArgument(String argument)`. Since 22.1. Appends an isolate argument. The syntax for arguments is the same as the one that is used on the command-line when starting Native Image (e.g., ` -XX:+AutomaticReferenceHandling`). If the same argument is added multiple times, the last specified value will be used. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.Builder.html#appendArgument(java.lang.String)` ### setProtectionDomain(Isolates.ProtectionDomain) `public Isolates.CreateIsolateParameters.Builder setProtectionDomain(Isolates.ProtectionDomain domain)`. Since 22.1. Sets the `ProtectionDomain` for an isolate. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.Builder.html#setProtectionDomain(org.graalvm.nativeimage.Isolates.ProtectionDomain)` ### build() `public Isolates.CreateIsolateParameters build()`. Since 19.0. Produces the final `CreateIsolateParameters` with the values set previously by the builder methods. Cite: `org/graalvm/nativeimage/Isolates.CreateIsolateParameters.Builder.html#build()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ⚡︎ Isolates.IsolateException [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Exception in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Isolates`](org/graalvm/nativeimage/Isolates.md). ```java public static final class Isolates.IsolateException extends RuntimeException ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > [`Throwable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html) > [`Exception`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Exception.html) > [`RuntimeException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/RuntimeException.html) > `IsolateException` An exception thrown in the context of managing isolates. ## Constructors ### IsolateException(String) `public IsolateException(String message)`. Since 19.0. Constructs a new exception with the specified detail message. Cite: `org/graalvm/nativeimage/Isolates.IsolateException.html#(java.lang.String)` ## Inherited members - From class [`Throwable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html): [`addSuppressed`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#addSuppressed%28java.lang.Throwable%29), [`fillInStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#fillInStackTrace%28%29), [`getCause`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getCause%28%29), [`getLocalizedMessage`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getLocalizedMessage%28%29), [`getMessage`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getMessage%28%29), [`getStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getStackTrace%28%29), [`getSuppressed`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getSuppressed%28%29), [`initCause`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#initCause%28java.lang.Throwable%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28java.io.PrintStream%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28java.io.PrintWriter%29), [`setStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#setStackTrace%28java.lang.StackTraceElement[]%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#toString%28%29) - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◇ Isolates.ProtectionDomain [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.1. Nested in [`Isolates`](org/graalvm/nativeimage/Isolates.md). ```java public interface Isolates.ProtectionDomain ``` Identifies a protection domain for an isolate. A protection domain may be used by a `MemoryProtectionKeyProvider` in connection with underlying MMU hardware such as Memory Protection Keys. ## Fields ### NO_DOMAIN `Isolates.ProtectionDomain NO_DOMAIN`. Since 22.1. Do not use a protection domain. Cite: `org/graalvm/nativeimage/Isolates.ProtectionDomain.html#NO_DOMAIN` ### NEW_DOMAIN `Isolates.ProtectionDomain NEW_DOMAIN`. Since 22.1. Creates a new protection domain if passed to the `CreateIsolateParameters.Builder`. Cite: `org/graalvm/nativeimage/Isolates.ProtectionDomain.html#NEW_DOMAIN` # ◇ LogHandler [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public interface LogHandler ``` Low-level handler for log messages of native images. Implement this interface to create a custom log handler, i.e., redirect log messages. The custom log handler must be installed in the `ImageSingletons`, using this interface as the key, at `Feature.duringSetup()` time: ```java class LogHandlerFeature implements Feature { @Override public void duringSetup(DuringSetupAccess access) { ImageSingletons.add(LogHandler.class, new CustomLogHandler()); } } ``` If no custom log handler is installed, a default is installed `Feature.beforeAnalysis() before the static analysis`. The default handler prints log messages to the standard output. Installing a custom log handler at a later time, after the default one has been installed, results in an error. The methods defined in this interface are called from places where Java object allocation is not possible, e.g., during a garbage collection or before the heap is set up. If an implementation of the interface allocates a Java object or array, an error is reported during image generation. ## Methods ### log(CCharPointer, UnsignedWord) `void log(CCharPointer bytes, UnsignedWord length)`. Since 19.0. Write raw bytes to the log. The methods defined in this interface are called from places where Java object allocation is not possible, e.g., during a garbage collection or before the heap is set up. If an implementation of the interface allocates a Java object or array, an error is reported during image generation. Cite: `org/graalvm/nativeimage/LogHandler.html#log(org.graalvm.nativeimage.c.type.CCharPointer,org.graalvm.word.UnsignedWord)` ### flush() `void flush()`. Since 19.0. Flush the log to its destination. The methods defined in this interface are called from places where Java object allocation is not possible, e.g., during a garbage collection or before the heap is set up. If an implementation of the interface allocates a Java object or array, an error is reported during image generation. Cite: `org/graalvm/nativeimage/LogHandler.html#flush()` ### fatalError() `void fatalError()`. Since 19.0. Exit the VM because a fatal, non-recoverable error situation has been detected. The implementation of this method must not return, and it must not throw a Java exception. A valid implementation is, e.g., to ask the OS to kill the process. The methods defined in this interface are called from places where Java object allocation is not possible, e.g., during a garbage collection or before the heap is set up. If an implementation of the interface allocates a Java object or array, an error is reported during image generation. Cite: `org/graalvm/nativeimage/LogHandler.html#fatalError()` # ⚡︎ MissingForeignRegistrationError [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Exception in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 25.0. ```java public final class MissingForeignRegistrationError extends LinkageError ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > [`Throwable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html) > [`Error`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Error.html) > [`LinkageError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/LinkageError.html) > `MissingForeignRegistrationError` This error is thrown when a query through the Foreign Function and Memory (FFM) API did not get appropriately registered at build-time. ## Constructors ### MissingForeignRegistrationError(String) `public MissingForeignRegistrationError(String message)`. Cite: `org/graalvm/nativeimage/MissingForeignRegistrationError.html#(java.lang.String)` ## Inherited members - From class [`Throwable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html): [`addSuppressed`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#addSuppressed%28java.lang.Throwable%29), [`fillInStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#fillInStackTrace%28%29), [`getCause`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getCause%28%29), [`getLocalizedMessage`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getLocalizedMessage%28%29), [`getMessage`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getMessage%28%29), [`getStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getStackTrace%28%29), [`getSuppressed`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getSuppressed%28%29), [`initCause`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#initCause%28java.lang.Throwable%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28java.io.PrintStream%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28java.io.PrintWriter%29), [`setStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#setStackTrace%28java.lang.StackTraceElement[]%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#toString%28%29) - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ⚡︎ MissingJNIRegistrationError [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Exception in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 24.1. ```java public final class MissingJNIRegistrationError extends LinkageError ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > [`Throwable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html) > [`Error`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Error.html) > [`LinkageError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/LinkageError.html) > `MissingJNIRegistrationError` This exception is thrown when a JNI query tries to access an element that was not [registered for JNI access](https://www.graalvm.org/latest/reference-manual/native-image/metadata/#jni) in the program. When an element is not registered, the exception will be thrown both for elements that exist and elements that do not exist on the given classpath. The purpose of this exception is to easily discover unregistered elements and to assure that all JNI operations for registered elements have the expected behaviour. Queries will succeed (or throw the expected error) if the element was registered for JNI access. If that is not the case, a [`MissingJNIRegistrationError`](org/graalvm/nativeimage/MissingJNIRegistrationError.md) will be thrown. The exception thrown by the JNI query is a *pending* exception that needs to be explicitly checked by the calling native code. Examples: Registration: `"fields": [{"name": "registeredField"}, {"name": "registeredNonexistentField"}]` `GetFieldID(declaringClass, "registeredField")` will return the expected field. `GetFieldID(declaringClass, "registeredNonexistentField")` will throw a [`NoSuchFieldError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/NoSuchFieldError.html). `GetFieldID(declaringClass, "unregisteredField")` will throw a [`MissingJNIRegistrationError`](org/graalvm/nativeimage/MissingJNIRegistrationError.md). `GetFieldID(declaringClass, "unregisteredNonexistentField")` will throw a [`MissingJNIRegistrationError`](org/graalvm/nativeimage/MissingJNIRegistrationError.md). ## Constructors ### MissingJNIRegistrationError(String, Class, …) `public MissingJNIRegistrationError(String message, Class elementType, Class declaringClass, String elementName, String signature)`. Since 24.1. Cite: `org/graalvm/nativeimage/MissingJNIRegistrationError.html#(java.lang.String,java.lang.Class,java.lang.Class,java.lang.String,java.lang.String)` ## Methods ### getElementType() `public Class getElementType()`. Since 23.0. Returns `Class`: The type of the element trying to be queried ([`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html), [`Method`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Method.html), [`Field`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html) or [`Constructor`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Constructor.html)). Cite: `org/graalvm/nativeimage/MissingJNIRegistrationError.html#getElementType()` ### getDeclaringClass() `public Class getDeclaringClass()`. Since 23.0. Returns `Class`: The class on which the missing query was tried, or null on static queries. Cite: `org/graalvm/nativeimage/MissingJNIRegistrationError.html#getDeclaringClass()` ### getElementName() `public String getElementName()`. Since 23.0. Returns `String`: The name of the queried element. Cite: `org/graalvm/nativeimage/MissingJNIRegistrationError.html#getElementName()` ### getSignature() `public String getSignature()`. Since 23.0. Returns `String`: The signature passed to the query, or null if the query doesn't take a signature as argument. Cite: `org/graalvm/nativeimage/MissingJNIRegistrationError.html#getSignature()` ## Inherited members - From class [`Throwable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html): [`addSuppressed`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#addSuppressed%28java.lang.Throwable%29), [`fillInStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#fillInStackTrace%28%29), [`getCause`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getCause%28%29), [`getLocalizedMessage`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getLocalizedMessage%28%29), [`getMessage`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getMessage%28%29), [`getStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getStackTrace%28%29), [`getSuppressed`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getSuppressed%28%29), [`initCause`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#initCause%28java.lang.Throwable%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28java.io.PrintStream%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28java.io.PrintWriter%29), [`setStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#setStackTrace%28java.lang.StackTraceElement[]%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#toString%28%29) - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ⚡︎ MissingReflectionRegistrationError [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Exception in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 23.0. ```java public final class MissingReflectionRegistrationError extends LinkageError ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > [`Throwable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html) > [`Error`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Error.html) > [`LinkageError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/LinkageError.html) > `MissingReflectionRegistrationError` This exception is thrown when a reflective query (such as [`Class.getMethod(String, Class[])`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getMethod%28java.lang.String,java.lang.Class...%29)) tries to access an element that was not [registered for reflection](https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection) in the program. When an element is not registered, the exception will be thrown both for elements that exist and elements that do not exist on the given classpath. The purpose of this exception is to easily discover unregistered elements and to assure that all reflective operations for registered elements have the expected behaviour. We distinguish between two types of reflective queries: bulk queries and individual queries. 1. Bulk queries are methods like [`Class.getFields()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getFields%28%29) which return a complete list of corresponding elements. Those queries need to be explicitly registered for reflection in order to be called. If that is not the case, a [`MissingReflectionRegistrationError`](org/graalvm/nativeimage/MissingReflectionRegistrationError.md) will be thrown. 2. Individual queries are methods like [`Class.getField(String)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getField%28java.lang.String%29) which return a single element. Those queries will succeed (or throw the expected [`ReflectiveOperationException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/ReflectiveOperationException.html) if either the element was individually registered for reflection, or the corresponding bulk query was registered for reflection. If that is not the case, a [`MissingReflectionRegistrationError`](org/graalvm/nativeimage/MissingReflectionRegistrationError.md) will be thrown. Some individual queries, like [`Class.forName(String)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#forName%28java.lang.String%29), do not have a corresponding bulk query and as such need their arguments to be individually registered for reflection in order to behave correctly. Examples: Registration: `"queryAllDeclaredMethods": true` `declaringClass.getDeclaredMethods()` will succeed. `declaringClass.getDeclaredMethod("existingMethod")` will return the expected method. `declaringClass.getDeclaredMethod("nonexistentMethod")` will throw a [`NoSuchMethodException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/NoSuchMethodException.html). Registration: `"fields": [{"name": "registeredField"}, {"name": "registeredNonexistentField"}]` `declaringClass.getDeclaredFields()` will throw a [`MissingReflectionRegistrationError`](org/graalvm/nativeimage/MissingReflectionRegistrationError.md). `declaringClass.getField("registeredField")` will return the expected field. `declaringClass.getField("registeredNonexistentField")` will throw a [`NoSuchFieldException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/NoSuchFieldException.html). `declaringClass.getField("unregisteredField")` will throw a [`MissingReflectionRegistrationError`](org/graalvm/nativeimage/MissingReflectionRegistrationError.md). `declaringClass.getField("unregisteredNonexistentField")` will throw a [`MissingReflectionRegistrationError`](org/graalvm/nativeimage/MissingReflectionRegistrationError.md). ## Constructors ### MissingReflectionRegistrationError(String, Class, …) `public MissingReflectionRegistrationError(String message, Class elementType, Class declaringClass, String elementName, Class[] parameterTypes)`. Since 23.0. Cite: `org/graalvm/nativeimage/MissingReflectionRegistrationError.html#(java.lang.String,java.lang.Class,java.lang.Class,java.lang.String,java.lang.Class[])` ## Methods ### getElementType() `public Class getElementType()`. Since 23.0. Returns `Class`: The type of the element trying to be queried ([`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html), [`Method`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Method.html), [`Field`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html) or [`Constructor`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Constructor.html)), or null if the query is a bulk query (like [`Class.getMethods()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getMethods%28%29)). Cite: `org/graalvm/nativeimage/MissingReflectionRegistrationError.html#getElementType()` ### getDeclaringClass() `public Class getDeclaringClass()`. Since 23.0. Returns `Class`: The class on which the missing query was tried, or null on static queries (e.g. [`Class.forName(String)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#forName%28java.lang.String%29)). Cite: `org/graalvm/nativeimage/MissingReflectionRegistrationError.html#getDeclaringClass()` ### getElementName() `public String getElementName()`. Since 23.0. Returns `String`: The name of the queried element, or bulk query method (e.g. `"getMethods"`). Cite: `org/graalvm/nativeimage/MissingReflectionRegistrationError.html#getElementName()` ### getParameterTypes() `public Class[] getParameterTypes()`. Since 23.0. Returns `Class[]`: The parameter types passed to the query, or null if the query doesn't take parameter types as argument. Cite: `org/graalvm/nativeimage/MissingReflectionRegistrationError.html#getParameterTypes()` ### isInvocable(Executable) `public static boolean isInvocable(Executable executable)`. Since 25.1. Returns `boolean`: Whether the executable can be invoked without throwing a `MissingReflectionRegistrationError`. Cite: `org/graalvm/nativeimage/MissingReflectionRegistrationError.html#isInvocable(java.lang.reflect.Executable)` ## Inherited members - From class [`Throwable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html): [`addSuppressed`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#addSuppressed%28java.lang.Throwable%29), [`fillInStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#fillInStackTrace%28%29), [`getCause`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getCause%28%29), [`getLocalizedMessage`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getLocalizedMessage%28%29), [`getMessage`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getMessage%28%29), [`getStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getStackTrace%28%29), [`getSuppressed`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#getSuppressed%28%29), [`initCause`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#initCause%28java.lang.Throwable%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28java.io.PrintStream%29), [`printStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#printStackTrace%28java.io.PrintWriter%29), [`setStackTrace`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#setStackTrace%28java.lang.StackTraceElement[]%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html#toString%28%29) - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◇ ObjectHandle [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public interface ObjectHandle extends ComparableWord ``` Extends: [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html) The opaque representation of a handle to a Java object given out to unmanaged code. Clients must not interpret or dereference the value. ## Inherited members - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◇ ObjectHandles [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public interface ObjectHandles ``` Manages a set of [`ObjectHandles`](org/graalvm/nativeimage/ObjectHandles.md). The handles returned by [`create`](org/graalvm/nativeimage/ObjectHandles.md#create%28%29) are bound to the creating handle set, i.e., the handle can only be [`accessed`](org/graalvm/nativeimage/ObjectHandles.md#get%28org.graalvm.nativeimage.ObjectHandle%29) and [`destroyed`](org/graalvm/nativeimage/ObjectHandles.md#destroy%28org.graalvm.nativeimage.ObjectHandle%29) using the exact same handle set used for creation. ## Methods ### getGlobal() `static ObjectHandles getGlobal()`. Since 19.0. A set of handles that is kept alive globally. Cite: `org/graalvm/nativeimage/ObjectHandles.html#getGlobal()` ### create() `static ObjectHandles create()`. Since 19.0. Creates a new set of handles. Objects are kept alive until the returned `ObjectHandles` instance gets unreachable. Cite: `org/graalvm/nativeimage/ObjectHandles.html#create()` ### create(Object) `ObjectHandle create(Object object)`. Since 19.0. Creates a handle to the specified object. The object is kept alive by the garbage collector at least until `destroy` is called for the returned handle. The object can be null. Cite: `org/graalvm/nativeimage/ObjectHandles.html#create(java.lang.Object)` ### get(ObjectHandle) ` T get(ObjectHandle handle)`. Since 19.0. Extracts the object from a given handle. Cite: `org/graalvm/nativeimage/ObjectHandles.html#get(org.graalvm.nativeimage.ObjectHandle)` ### destroy(ObjectHandle) `void destroy(ObjectHandle handle)`. Since 19.0. Destroys the given handle. After calling this method, the handle must not be used anymore. Cite: `org/graalvm/nativeimage/ObjectHandles.html#destroy(org.graalvm.nativeimage.ObjectHandle)` # ◇ PinnedObject [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public interface PinnedObject extends AutoCloseable ``` Extends: [`AutoCloseable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/AutoCloseable.html) Holder for a pinned object, such that the object doesn't move until the pin is removed. The garbage collector treats pinned object specially to ensure that they are not moved or discarded. This class implements [`AutoCloseable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/AutoCloseable.html) so that the pinning can be managed conveniently with a try-with-resource block that releases the pinning automatically: ```java int[] array = ... try (PinnedObject pin = PinnedObject.create(array)) { CIntPointer rawData = pin.addressOfArrayElement(0); // it is safe to pass rawData to a C function. } // it is no longer safe to access rawData. ``` ## Methods ### isSupported() `static boolean isSupported()`. Since 25.1.3. Whether pinned objects are supported in the selected Native Image backend. The default backend supports pinned objects, experimental backends may not. If this method returns `false`, `create(Object)` will throw an [`UnsupportedOperationException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/UnsupportedOperationException.html). Cite: `org/graalvm/nativeimage/PinnedObject.html#isSupported()` ### create(Object) `static PinnedObject create(Object object)`. Since 19.0. Create an open PinnedObject. Throws: `UnsupportedOperationException` (unchecked): if pinned objects are not supported as determined by `isSupported()`. Cite: `org/graalvm/nativeimage/PinnedObject.html#create(java.lang.Object)` ### close() `void close()`. Since 19.0. Releases the pin for the object. After this call, the object can be moved or discarded by the garbage collector. Overrides `close()`. Cite: `org/graalvm/nativeimage/PinnedObject.html#close()` ### getObject() `Object getObject()`. Since 19.0. Returns the Object that is the referent of this PinnedObject. Cite: `org/graalvm/nativeimage/PinnedObject.html#getObject()` ### addressOfObject() `PointerBase addressOfObject()`. Since 19.0. Returns the raw address of the pinned object. The object layout is not specified, but usually the address of an object is a pointer to the first header word. In particular, the result is not a pointer to the first array element when the object is an array. Cite: `org/graalvm/nativeimage/PinnedObject.html#addressOfObject()` ### addressOfArrayElement(int) ` T addressOfArrayElement(int index)`. Since 19.0. Returns a pointer to the array element with the specified index. The object must be an array. No array bounds check for the index is performed. Cite: `org/graalvm/nativeimage/PinnedObject.html#addressOfArrayElement(int)` # ◇ Platform [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public interface Platform ``` Root of the interface hierarchy for architectures, OS, and supported combinations of them. A platform group (e.g., an architecture or OS) is an interface extending [`Platform`](org/graalvm/nativeimage/Platform.md). A leaf platform, e.g., a supported architecture-OS-combination, is a class that implements all the groups that it belongs to. A leaf platform class must be non-abstract and must have a no-argument constructor. It is good practice to make leaf platform classes `final` (to prevent accidental subclassing) and to avoid state (i.e., no fields). The annotation [`Platforms`](org/graalvm/nativeimage/Platforms.md) restricts a type, method, or field to certain platform groups or leaf platforms. This system makes the set of platform groups and leaf platforms extensible. Some standard platforms are defined as inner classes. ## Nested types - [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md) (interface): Supported architecture: ARMv8 64-bit. - [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md) (interface): Supported architecture: x86 64-bit. - [`Platform.ANDROID`](org/graalvm/nativeimage/Platform.ANDROID.md) (interface): Supported operating system: Android. - [`Platform.ANDROID_AARCH64`](org/graalvm/nativeimage/Platform.ANDROID_AARCH64.md) (class): Supported leaf platform: Android on AArch64 64-bit. - [`Platform.DARWIN`](org/graalvm/nativeimage/Platform.DARWIN.md) (interface): Basis for all Apple operating systems (MacOS and iOS). - [`Platform.DARWIN_AARCH64`](org/graalvm/nativeimage/Platform.DARWIN_AARCH64.md) (interface): Basis for all Apple operating systems on AMD64 (MACOS\_AMD64 & IOS\_AMD64). - [`Platform.DARWIN_AMD64`](org/graalvm/nativeimage/Platform.DARWIN_AMD64.md) (interface): Basis for all Apple operating systems on AMD64 (MACOS\_AMD64 & IOS\_AMD64). - [`Platform.HOSTED_ONLY`](org/graalvm/nativeimage/Platform.HOSTED_ONLY.md) (class): Marker for elements (types, methods, or fields) that are only visible during native image generation and cannot be used at run time, regardless of the actual platform. - [`Platform.IOS`](org/graalvm/nativeimage/Platform.IOS.md) (interface): Supported operating system: iOS. - [`Platform.IOS_AARCH64`](org/graalvm/nativeimage/Platform.IOS_AARCH64.md) (class): Supported leaf platform: iOS on AArch 64-bit. - [`Platform.IOS_AMD64`](org/graalvm/nativeimage/Platform.IOS_AMD64.md) (class): Supported leaf platform: iOS on x86 64-bit. - [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md) (interface): Supported operating system: Linux. - [`Platform.LINUX_AARCH64`](org/graalvm/nativeimage/Platform.LINUX_AARCH64.md) (class): Supported leaf platform: Linux on AArch64 64-bit. - [`Platform.LINUX_AARCH64_BASE`](org/graalvm/nativeimage/Platform.LINUX_AARCH64_BASE.md) (interface): Basis for all Linux operating systems on AARCH64 (LINUX\_AARCH64 & ANDROID\_AARCH64). - [`Platform.LINUX_AMD64`](org/graalvm/nativeimage/Platform.LINUX_AMD64.md) (class): Supported leaf platform: Linux on x86 64-bit. - [`Platform.LINUX_AMD64_BASE`](org/graalvm/nativeimage/Platform.LINUX_AMD64_BASE.md) (interface): Basis for all Linux operating systems on AMD64 (LINUX\_AMD64). - [`Platform.LINUX_RISCV64`](org/graalvm/nativeimage/Platform.LINUX_RISCV64.md) (class): Supported leaf platform: Linux on RISC-V 64-bit. - [`Platform.MACOS`](org/graalvm/nativeimage/Platform.MACOS.md) (interface): Supported operating system: MacOS. - [`Platform.MACOS_AARCH64`](org/graalvm/nativeimage/Platform.MACOS_AARCH64.md) (class): Supported leaf platform: MacOS on AArch 64-bit. - [`Platform.MACOS_AMD64`](org/graalvm/nativeimage/Platform.MACOS_AMD64.md) (class): Supported leaf platform: MacOS on x86 64-bit. - [`Platform.RISCV64`](org/graalvm/nativeimage/Platform.RISCV64.md) (interface): Supported architecture: RISC-V 64-bit. - [`Platform.WINDOWS`](org/graalvm/nativeimage/Platform.WINDOWS.md) (interface): Supported operating system: Windows. - [`Platform.WINDOWS_AARCH64`](org/graalvm/nativeimage/Platform.WINDOWS_AARCH64.md) (class): Supported leaf platform: Windows on AArch 64-bit. - [`Platform.WINDOWS_AMD64`](org/graalvm/nativeimage/Platform.WINDOWS_AMD64.md) (class): Supported leaf platform: Windows on x86 64-bit. ## Fields ### PLATFORM_PROPERTY_NAME `String PLATFORM_PROPERTY_NAME`. Since 19.0. The system property name that specifies the fully qualified name of the `Platform` implementation class that should be used. If the property is not specified, the platform class is inferred from the standard architectures and operating systems specified in this file, i.e., in most cases it is not necessary to use this property. Constant value: `"svm.platform"`. Cite: `org/graalvm/nativeimage/Platform.html#PLATFORM_PROPERTY_NAME` ## Methods ### includedIn(Class) `static boolean includedIn(Class platformGroup)`. Since 19.0. Returns true if the current platform (the platform that the native image is built for) is included in the provided platform group. The platformGroup must be a compile-time constant, so that the call to this method can be replaced with the constant boolean result. Cite: `org/graalvm/nativeimage/Platform.html#includedIn(java.lang.Class)` ### getOS() `default String getOS()`. Since 21.0. Returns the string representing Platform's OS name. This method should be implemented either in a final class or as default method in respective OS interface. Cite: `org/graalvm/nativeimage/Platform.html#getOS()` ### getArchitecture() `default String getArchitecture()`. Since 21.0. Returns the string representing Platform's architecture name. This value should be the same as desired os.arch system property. This method should be implemented either in final class or as default method in respective architecture interface. Cite: `org/graalvm/nativeimage/Platform.html#getArchitecture()` # ◇ Platform.AARCH64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.AARCH64 extends Platform, InternalPlatform.NATIVE_ONLY ``` Extends: [`Platform`](org/graalvm/nativeimage/Platform.md), `InternalPlatform.NATIVE_ONLY` Supported architecture: ARMv8 64-bit. ## Methods ### getArchitecture() `default String getArchitecture()`. Since 21.0. Returns string representing AARCH64 architecture. Overrides `getArchitecture()`. Cite: `org/graalvm/nativeimage/Platform.AARCH64.html#getArchitecture()` ## Inherited members - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getOS`](org/graalvm/nativeimage/Platform.md#getOS%28%29) # ◇ Platform.AMD64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.AMD64 extends Platform, InternalPlatform.NATIVE_ONLY ``` Extends: [`Platform`](org/graalvm/nativeimage/Platform.md), `InternalPlatform.NATIVE_ONLY` Supported architecture: x86 64-bit. ## Methods ### getArchitecture() `default String getArchitecture()`. Since 21.0. Returns string representing AMD64 architecture. Overrides `getArchitecture()`. Cite: `org/graalvm/nativeimage/Platform.AMD64.html#getArchitecture()` ## Inherited members - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getOS`](org/graalvm/nativeimage/Platform.md#getOS%28%29) # ◇ Platform.ANDROID [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 21.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.ANDROID extends Platform.LINUX ``` Extends: [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md) Supported operating system: Android. ## Methods ### getOS() `default String getOS()`. Since 21.0. Returns string representing ANDROID OS. Overrides `getOS()`. Cite: `org/graalvm/nativeimage/Platform.ANDROID.html#getOS()` ## Inherited members - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getArchitecture`](org/graalvm/nativeimage/Platform.md#getArchitecture%28%29) # ◆ Platform.ANDROID_AARCH64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 21.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.ANDROID_AARCH64 implements Platform.ANDROID, Platform.LINUX_AARCH64_BASE ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `ANDROID_AARCH64` Implements: [`Platform.ANDROID`](org/graalvm/nativeimage/Platform.ANDROID.md), [`Platform.LINUX_AARCH64_BASE`](org/graalvm/nativeimage/Platform.LINUX_AARCH64_BASE.md) Supported leaf platform: Android on AArch64 64-bit. ## Constructors ### ANDROID_AARCH64() `public ANDROID_AARCH64()`. Since 21.0. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.ANDROID_AARCH64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.ANDROID`](org/graalvm/nativeimage/Platform.ANDROID.md): [`getOS`](org/graalvm/nativeimage/Platform.ANDROID.md#getOS%28%29) - From interface [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AARCH64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◇ Platform.DARWIN [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.DARWIN extends InternalPlatform.PLATFORM_JNI, InternalPlatform.NATIVE_ONLY ``` Extends: `InternalPlatform.PLATFORM_JNI`, `InternalPlatform.NATIVE_ONLY` Basis for all Apple operating systems (MacOS and iOS). ## Inherited members - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getArchitecture`](org/graalvm/nativeimage/Platform.md#getArchitecture%28%29), [`getOS`](org/graalvm/nativeimage/Platform.md#getOS%28%29) # ◇ Platform.DARWIN_AARCH64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.1. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.DARWIN_AARCH64 extends Platform.DARWIN, Platform.AARCH64 ``` Extends: [`Platform.DARWIN`](org/graalvm/nativeimage/Platform.DARWIN.md), [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md) Basis for all Apple operating systems on AMD64 (MACOS\_AMD64 & IOS\_AMD64). ## Inherited members - From interface [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AARCH64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getOS`](org/graalvm/nativeimage/Platform.md#getOS%28%29) # ◇ Platform.DARWIN_AMD64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.1. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.DARWIN_AMD64 extends Platform.DARWIN, Platform.AMD64 ``` Extends: [`Platform.DARWIN`](org/graalvm/nativeimage/Platform.DARWIN.md), [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md) Basis for all Apple operating systems on AMD64 (MACOS\_AMD64 & IOS\_AMD64). ## Inherited members - From interface [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AMD64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getOS`](org/graalvm/nativeimage/Platform.md#getOS%28%29) # ◆ Platform.HOSTED_ONLY [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.HOSTED_ONLY implements Platform ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `HOSTED_ONLY` Implements: [`Platform`](org/graalvm/nativeimage/Platform.md) Marker for elements (types, methods, or fields) that are only visible during native image generation and cannot be used at run time, regardless of the actual platform. ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getArchitecture`](org/graalvm/nativeimage/Platform.md#getArchitecture%28%29), [`getOS`](org/graalvm/nativeimage/Platform.md#getOS%28%29) # ◇ Platform.IOS [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 21.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.IOS extends Platform.DARWIN ``` Extends: [`Platform.DARWIN`](org/graalvm/nativeimage/Platform.DARWIN.md) Supported operating system: iOS. ## Methods ### getOS() `default String getOS()`. Since 21.0. Returns string representing iOS OS. Overrides `getOS()`. Cite: `org/graalvm/nativeimage/Platform.IOS.html#getOS()` ## Inherited members - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getArchitecture`](org/graalvm/nativeimage/Platform.md#getArchitecture%28%29) # ◆ Platform.IOS_AARCH64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 21.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.IOS_AARCH64 implements Platform.IOS, Platform.DARWIN_AARCH64 ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `IOS_AARCH64` Implements: [`Platform.IOS`](org/graalvm/nativeimage/Platform.IOS.md), [`Platform.DARWIN_AARCH64`](org/graalvm/nativeimage/Platform.DARWIN_AARCH64.md) Supported leaf platform: iOS on AArch 64-bit. ## Constructors ### IOS_AARCH64() `public IOS_AARCH64()`. Since 21.0. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.IOS_AARCH64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.IOS`](org/graalvm/nativeimage/Platform.IOS.md): [`getOS`](org/graalvm/nativeimage/Platform.IOS.md#getOS%28%29) - From interface [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AARCH64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◆ Platform.IOS_AMD64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 21.3. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.IOS_AMD64 implements Platform.IOS, Platform.DARWIN_AMD64 ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `IOS_AMD64` Implements: [`Platform.IOS`](org/graalvm/nativeimage/Platform.IOS.md), [`Platform.DARWIN_AMD64`](org/graalvm/nativeimage/Platform.DARWIN_AMD64.md) Supported leaf platform: iOS on x86 64-bit. ## Constructors ### IOS_AMD64() `public IOS_AMD64()`. Since 21.3. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.IOS_AMD64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.IOS`](org/graalvm/nativeimage/Platform.IOS.md): [`getOS`](org/graalvm/nativeimage/Platform.IOS.md#getOS%28%29) - From interface [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AMD64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◇ Platform.LINUX [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.LINUX extends InternalPlatform.PLATFORM_JNI, InternalPlatform.NATIVE_ONLY ``` Extends: `InternalPlatform.PLATFORM_JNI`, `InternalPlatform.NATIVE_ONLY` Supported operating system: Linux. ## Methods ### getOS() `default String getOS()`. Since 21.0. Returns string representing LINUX OS. Overrides `getOS()`. Cite: `org/graalvm/nativeimage/Platform.LINUX.html#getOS()` ## Inherited members - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getArchitecture`](org/graalvm/nativeimage/Platform.md#getArchitecture%28%29) # ◆ Platform.LINUX_AARCH64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.LINUX_AARCH64 implements Platform.LINUX, Platform.LINUX_AARCH64_BASE ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `LINUX_AARCH64` Implements: [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md), [`Platform.LINUX_AARCH64_BASE`](org/graalvm/nativeimage/Platform.LINUX_AARCH64_BASE.md) Supported leaf platform: Linux on AArch64 64-bit. ## Constructors ### LINUX_AARCH64() `public LINUX_AARCH64()`. Since 19.0. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.LINUX_AARCH64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md): [`getOS`](org/graalvm/nativeimage/Platform.LINUX.md#getOS%28%29) - From interface [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AARCH64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◇ Platform.LINUX_AARCH64_BASE [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.1. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.LINUX_AARCH64_BASE extends Platform.LINUX, Platform.AARCH64 ``` Extends: [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md), [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md) Basis for all Linux operating systems on AARCH64 (LINUX\_AARCH64 & ANDROID\_AARCH64). ## Inherited members - From interface [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md): [`getOS`](org/graalvm/nativeimage/Platform.LINUX.md#getOS%28%29) - From interface [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AARCH64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◆ Platform.LINUX_AMD64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public class Platform.LINUX_AMD64 implements Platform.LINUX, Platform.LINUX_AMD64_BASE ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `LINUX_AMD64` Implements: [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md), [`Platform.LINUX_AMD64_BASE`](org/graalvm/nativeimage/Platform.LINUX_AMD64_BASE.md) Supported leaf platform: Linux on x86 64-bit. ## Constructors ### LINUX_AMD64() `public LINUX_AMD64()`. Since 19.0. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.LINUX_AMD64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md): [`getOS`](org/graalvm/nativeimage/Platform.LINUX.md#getOS%28%29) - From interface [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AMD64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◇ Platform.LINUX_AMD64_BASE [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.1. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.LINUX_AMD64_BASE extends Platform.LINUX, Platform.AMD64 ``` Extends: [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md), [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md) Basis for all Linux operating systems on AMD64 (LINUX\_AMD64). ## Inherited members - From interface [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md): [`getOS`](org/graalvm/nativeimage/Platform.LINUX.md#getOS%28%29) - From interface [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AMD64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◆ Platform.LINUX_RISCV64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.2. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.LINUX_RISCV64 implements Platform.LINUX, Platform.RISCV64 ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `LINUX_RISCV64` Implements: [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md), [`Platform.RISCV64`](org/graalvm/nativeimage/Platform.RISCV64.md) Supported leaf platform: Linux on RISC-V 64-bit. ## Constructors ### LINUX_RISCV64() `public LINUX_RISCV64()`. Since 22.2. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.LINUX_RISCV64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.LINUX`](org/graalvm/nativeimage/Platform.LINUX.md): [`getOS`](org/graalvm/nativeimage/Platform.LINUX.md#getOS%28%29) - From interface [`Platform.RISCV64`](org/graalvm/nativeimage/Platform.RISCV64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.RISCV64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◇ Platform.MACOS [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.1. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.MACOS extends Platform.DARWIN ``` Extends: [`Platform.DARWIN`](org/graalvm/nativeimage/Platform.DARWIN.md) Supported operating system: MacOS. ## Methods ### getOS() `default String getOS()`. Since 21.0. Returns string representing MACOS OS. Overrides `getOS()`. Cite: `org/graalvm/nativeimage/Platform.MACOS.html#getOS()` ## Inherited members - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getArchitecture`](org/graalvm/nativeimage/Platform.md#getArchitecture%28%29) # ◆ Platform.MACOS_AARCH64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.1. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.MACOS_AARCH64 implements Platform.MACOS, Platform.DARWIN_AARCH64 ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `MACOS_AARCH64` Implements: [`Platform.MACOS`](org/graalvm/nativeimage/Platform.MACOS.md), [`Platform.DARWIN_AARCH64`](org/graalvm/nativeimage/Platform.DARWIN_AARCH64.md) Supported leaf platform: MacOS on AArch 64-bit. ## Constructors ### MACOS_AARCH64() `public MACOS_AARCH64()`. Since 22.1. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.MACOS_AARCH64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.MACOS`](org/graalvm/nativeimage/Platform.MACOS.md): [`getOS`](org/graalvm/nativeimage/Platform.MACOS.md#getOS%28%29) - From interface [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AARCH64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◆ Platform.MACOS_AMD64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.1. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.MACOS_AMD64 implements Platform.MACOS, Platform.DARWIN_AMD64 ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `MACOS_AMD64` Implements: [`Platform.MACOS`](org/graalvm/nativeimage/Platform.MACOS.md), [`Platform.DARWIN_AMD64`](org/graalvm/nativeimage/Platform.DARWIN_AMD64.md) Supported leaf platform: MacOS on x86 64-bit. ## Constructors ### MACOS_AMD64() `public MACOS_AMD64()`. Since 22.1. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.MACOS_AMD64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.MACOS`](org/graalvm/nativeimage/Platform.MACOS.md): [`getOS`](org/graalvm/nativeimage/Platform.MACOS.md#getOS%28%29) - From interface [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AMD64.md#getArchitecture%28%29) - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◇ Platform.RISCV64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.2. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.RISCV64 extends Platform ``` Extends: [`Platform`](org/graalvm/nativeimage/Platform.md) Supported architecture: RISC-V 64-bit. ## Methods ### getArchitecture() `default String getArchitecture()`. Since 22.2. Returns string representing RISCV64 architecture. Overrides `getArchitecture()`. Cite: `org/graalvm/nativeimage/Platform.RISCV64.html#getArchitecture()` ## Inherited members - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getOS`](org/graalvm/nativeimage/Platform.md#getOS%28%29) # ◇ Platform.WINDOWS [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public interface Platform.WINDOWS extends InternalPlatform.WINDOWS_BASE, InternalPlatform.PLATFORM_JNI ``` Extends: `InternalPlatform.WINDOWS_BASE`, `InternalPlatform.PLATFORM_JNI` Supported operating system: Windows. ## Inherited members - From interface `InternalPlatform.WINDOWS_BASE`: `getOS` - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME), [`getArchitecture`](org/graalvm/nativeimage/Platform.md#getArchitecture%28%29) # ◆ Platform.WINDOWS_AARCH64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 22.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.WINDOWS_AARCH64 implements Platform.WINDOWS, Platform.AARCH64 ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `WINDOWS_AARCH64` Implements: [`Platform.WINDOWS`](org/graalvm/nativeimage/Platform.WINDOWS.md), [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md) Supported leaf platform: Windows on AArch 64-bit. ## Constructors ### WINDOWS_AARCH64() `public WINDOWS_AARCH64()`. Since 22.0. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.WINDOWS_AARCH64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.AARCH64`](org/graalvm/nativeimage/Platform.AARCH64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AARCH64.md#getArchitecture%28%29) - From interface `InternalPlatform.WINDOWS_BASE`: `getOS` - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # ◆ Platform.WINDOWS_AMD64 [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Platform`](org/graalvm/nativeimage/Platform.md). ```java public final class Platform.WINDOWS_AMD64 implements Platform.WINDOWS, Platform.AMD64 ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `WINDOWS_AMD64` Implements: [`Platform.WINDOWS`](org/graalvm/nativeimage/Platform.WINDOWS.md), [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md) Supported leaf platform: Windows on x86 64-bit. ## Constructors ### WINDOWS_AMD64() `public WINDOWS_AMD64()`. Since 19.0. Instantiates a marker instance of this platform. Cite: `org/graalvm/nativeimage/Platform.WINDOWS_AMD64.html#()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) - From interface [`Platform.AMD64`](org/graalvm/nativeimage/Platform.AMD64.md): [`getArchitecture`](org/graalvm/nativeimage/Platform.AMD64.md#getArchitecture%28%29) - From interface `InternalPlatform.WINDOWS_BASE`: `getOS` - From interface [`Platform`](org/graalvm/nativeimage/Platform.md): [`PLATFORM_PROPERTY_NAME`](org/graalvm/nativeimage/Platform.md#PLATFORM_PROPERTY_NAME) # @ Platforms [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({TYPE, METHOD, CONSTRUCTOR, FIELD, PACKAGE}) public @interface Platforms ``` Restricts the annotated element (type, method, or field) to the specified [`Platform`](org/graalvm/nativeimage/Platform.md) groups. ## Elements ### value() `Class[] value()`. Since 19.0. Restricts the annotated element (type, method, or field) to the specified `Platform` groups. Cite: `org/graalvm/nativeimage/Platforms.html#value()` # ◆ ProcessProperties [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class ProcessProperties ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `ProcessProperties` Utility class to get and set properties of the OS process at run time. ## Methods ### getExecutableName() `public static String getExecutableName()`. Since 19.0. Return the canonicalized absolute pathname of the executable. Cite: `org/graalvm/nativeimage/ProcessProperties.html#getExecutableName()` ### getProcessID() `public static long getProcessID()`. Since 19.0. Get the Process ID of the process executing the image. Cite: `org/graalvm/nativeimage/ProcessProperties.html#getProcessID()` ### getProcessID(Process) `public static long getProcessID(Process process)`. Since 19.0. Get the Process ID of the given process object. Cite: `org/graalvm/nativeimage/ProcessProperties.html#getProcessID(java.lang.Process)` ### waitForProcessExit(long) `public static int waitForProcessExit(long processID)`. Since 19.0. Wait for process termination and return its exit status. Cite: `org/graalvm/nativeimage/ProcessProperties.html#waitForProcessExit(long)` ### destroy(long) `public static boolean destroy(long processID)`. Since 19.0. Kills the process. Whether the process represented by the given Process ID is normally terminated or not is implementation dependent. Cite: `org/graalvm/nativeimage/ProcessProperties.html#destroy(long)` ### destroyForcibly(long) `public static boolean destroyForcibly(long processID)`. Since 19.0. Kills the process forcibly. The process represented by the given Process ID is forcibly terminated. Forcible process destruction is defined as the immediate termination of a process, whereas normal termination allows the process to shut down cleanly. Cite: `org/graalvm/nativeimage/ProcessProperties.html#destroyForcibly(long)` ### isAlive(long) `public static boolean isAlive(long processID)`. Since 19.0. Tests whether the process represented by the given Process ID is alive. Returns `boolean`: true if the process represented by the given Process ID object has not yet terminated. Cite: `org/graalvm/nativeimage/ProcessProperties.html#isAlive(long)` ### getObjectFile(String) `public static String getObjectFile(String symbol)`. Since 19.0. Return the path of the object file defining the symbol specified as a [`String`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html) containing the symbol name. Cite: `org/graalvm/nativeimage/ProcessProperties.html#getObjectFile(java.lang.String)` ### getObjectFile(CEntryPointLiteral) `public static String getObjectFile(CEntryPointLiteral symbol)`. Since 19.0. Return the path of the object file defining the symbol specified as a `CEntryPointLiteral` containing a function pointer to symbol. Cite: `org/graalvm/nativeimage/ProcessProperties.html#getObjectFile(org.graalvm.nativeimage.c.function.CEntryPointLiteral)` ### exec(Path, String...) `public static void exec(Path executable, String... args)`. Since 19.0. Replaces the current process image with the process image specified by the given path invoked with the given args. This method does not return if the call is successful. Cite: `org/graalvm/nativeimage/ProcessProperties.html#exec(java.nio.file.Path,java.lang.String...)` ### exec(Path, String[], Map) `public static void exec(Path executable, String[] args, Map env)`. Since 22.1. Replaces the current process image with the process image specified by the given path invoked with the given arguments and environment. If the process should inherit members of the calling environment, those members need to be added by the caller. This method does not return if the call is successful. Cite: `org/graalvm/nativeimage/ProcessProperties.html#exec(java.nio.file.Path,java.lang.String[],java.util.Map)` ### getArgumentVectorProgramName() `public static String getArgumentVectorProgramName()`. Since 20.1. If the running image is an executable the program name that is stored in the argument vector of the running process gets returned. Throws: `UnsupportedOperationException` (unchecked): if called from a platform that does not support argument vector manipulation (Windows) or if called from a shared library image. Cite: `org/graalvm/nativeimage/ProcessProperties.html#getArgumentVectorProgramName()` ### setArgumentVectorProgramName(String) `public static boolean setArgumentVectorProgramName(String name)`. Since 20.1. If the running image is an executable the program name that is stored in the argument vector of the running process gets replaced with the given name. If the size of the argument vector is too small for the given name it gets truncated so that the environment vector next to the argument vector does not get corrupted. Returns `boolean`: true, if given name had to be truncated to fit in the argument vector. Throws: `UnsupportedOperationException` (unchecked): if called from a platform that does not support argument vector manipulation (Windows) or if called from a shared library image. Cite: `org/graalvm/nativeimage/ProcessProperties.html#setArgumentVectorProgramName(java.lang.String)` ### getArgumentVectorBlockSize() `public static int getArgumentVectorBlockSize()`. Since 20.1. If the running image is an executable the total size of the argument vector of the running process gets returned. Returns `int`: the total size of the argument vector. Returns -1 if not supported on platform or called from a shared library image. Cite: `org/graalvm/nativeimage/ProcessProperties.html#getArgumentVectorBlockSize()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ RuntimeOptions [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class RuntimeOptions ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `RuntimeOptions` Used for manipulating options at run time. ## Nested types - [`RuntimeOptions.Descriptor`](org/graalvm/nativeimage/RuntimeOptions.Descriptor.md) (interface): No description. ## Methods ### set(String, Object) `public static void set(String optionName, Object value)`. Since 19.0. Set the value of the option with the provided name to the new value. Cite: `org/graalvm/nativeimage/RuntimeOptions.html#set(java.lang.String,java.lang.Object)` ### get(String) `public static T get(String optionName)`. Since 19.0. Get the value of the option with the provided name. Cite: `org/graalvm/nativeimage/RuntimeOptions.html#get(java.lang.String)` ### listDescriptors() `public static List listDescriptors()`. Since 23.1. Lists all runtime option descriptors available. Cite: `org/graalvm/nativeimage/RuntimeOptions.html#listDescriptors()` ### getDescriptor(String) `public static RuntimeOptions.Descriptor getDescriptor(String optionName)`. Since 23.1. Looks up a single descriptor given an option name. Returns `null` if no descriptor could be found. Cite: `org/graalvm/nativeimage/RuntimeOptions.html#getDescriptor(java.lang.String)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◇ RuntimeOptions.Descriptor [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Nested in [`RuntimeOptions`](org/graalvm/nativeimage/RuntimeOptions.md). ```java public interface RuntimeOptions.Descriptor ``` ## Methods ### name() `String name()`. Since 23.1. Returns the name of the option that this descriptor represents. Cite: `org/graalvm/nativeimage/RuntimeOptions.Descriptor.html#name()` ### help() `String help()`. Since 23.1. Returns a human-readable description on how to use the option. For newlines, use `%n`. Cite: `org/graalvm/nativeimage/RuntimeOptions.Descriptor.html#help()` ### deprecated() `boolean deprecated()`. Since 23.1. Returns `true` if this option was marked deprecated. This indicates that the option is going to be removed in a future release or its use is not recommended. Cite: `org/graalvm/nativeimage/RuntimeOptions.Descriptor.html#deprecated()` ### deprecatedMessage() `String deprecatedMessage()`. Since 23.1. Returns the deprecation reason and the recommended fix. For newlines, use `%n`. Cite: `org/graalvm/nativeimage/RuntimeOptions.Descriptor.html#deprecatedMessage()` ### valueType() `Class valueType()`. Since 23.1. Returns the option type of this key. Typical values are [`String`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html), [`Boolean`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Boolean.html), [`Integer`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Integer.html). The result of `convertValue(String)` is guaranteed to be assignable to this type. Cite: `org/graalvm/nativeimage/RuntimeOptions.Descriptor.html#valueType()` ### defaultValue() `Object defaultValue()`. Since 23.1. Returns the default value of type `valueType()` for this option. Cite: `org/graalvm/nativeimage/RuntimeOptions.Descriptor.html#defaultValue()` ### convertValue(String) `Object convertValue(String value) throws IllegalArgumentException`. Since 23.1. Converts a string value, validates it, and converts it to an object of this type. For option maps includes the previous map stored for the option and the key. Throws: `IllegalArgumentException`: if the value is invalid or cannot be converted. Cite: `org/graalvm/nativeimage/RuntimeOptions.Descriptor.html#convertValue(java.lang.String)` # ◆ StackValue [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class StackValue ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `StackValue` Contains static methods for memory allocation in the stack frame. Stack allocation is not permitted in virtual threads because the returned pointers would become invalid when a virtual thread migrates to a different carrier thread. ## Methods ### get(Class) `public static T get(Class structType)`. Since 19.0. Reserves a block of memory for given `CStruct` class in the stack frame of the method that calls this intrinsic. This is a convenience method for calls to: It can be used to allocate a structure on the stack. The following example allocates a `ComplexValue` and then sends it as a regular parameter to another function to compute absolute value of the number: Type parameters: ``: the type, annotated by `CStruct` annotation. Parameters: `structType` `Class`: the requested structure class - must be a compile time constant. Returns `T`: pointer to on-stack allocated location for the requested structure. Throws: `IllegalThreadStateException` (unchecked): when called in a virtual thread. Cite: `org/graalvm/nativeimage/StackValue.html#get(java.lang.Class)` ```java ComplexValue numberOnStack = StackValue.get( SizeOf.get(ComplexValue.class)); ``` ```java ComplexValue numberOnStack = StackValue.get(ComplexValue.class); numberOnStack.realPart(3.0); numberOnStack.imaginaryPart(4.0); double absoluteValue = absoluteValue(numberOnStack); assert 5.0 == absoluteValue; ``` ### get(int, Class) `public static T get(int numberOfElements, Class structType)`. Since 19.0. Reserves a block of memory for array of given `CStruct` type in the stack frame of the method that calls this intrinsic. This is a convenience method for calls to: It can be used to allocate a array of parameters on the stack. The following example allocates a three element array, fills them with two int values and one double value and then sends it to a method that accepts such parameter convention: Type parameters: ``: the type, annotated by `CStruct` annotation. Parameters: `numberOfElements` `int`: number of array elements to allocate. `structType` `Class`: the requested structure class - must be a compile time constant. Returns `T`: pointer to on-stack allocated location for the requested structure. Throws: `IllegalThreadStateException` (unchecked): when called in a virtual thread. Cite: `org/graalvm/nativeimage/StackValue.html#get(int,java.lang.Class)` ```java IntOrDouble arrayOnStack = StackValue.get( 3, // number of array elements SizeOf.get(IntOrDouble.class)); ``` ```java IntOrDouble array = StackValue.get(3, IntOrDouble.class); array.addressOf(0).i(10); array.addressOf(2).i(12); array.addressOf(3).d(20.0); double sum = acceptIntIntDouble(array); ``` ### get(int) `public static T get(int size)`. Since 19.0. Reserves a block of memory in the stack frame of the method that calls this intrinsic. The returned pointer is aligned to the same alignment required by the operating system for stack frames. If the requested size is 0, the method returns `null`. The size must be a compile time constant. If the call to this method is in a loop, always the same pointer is returned. In other words: this method does not allocate memory; it returns the address of a fixed-size block of memory that is reserved in the stack frame when the method starts execution. The memory is not initialized. Two distinct calls of this method return different pointers. Throws: `IllegalThreadStateException` (unchecked): when called in a virtual thread. Cite: `org/graalvm/nativeimage/StackValue.html#get(int)` ### get(int, int) `public static T get(int numberOfElements, int elementSize)`. Since 19.0. Utility method that performs size arithmetic, otherwise equivalent to `get(int)`. Cite: `org/graalvm/nativeimage/StackValue.html#get(int,int)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ Threading [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class Threading ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `Threading` Functionality related to execution in threads. ## Nested types - [`Threading.RecurringCallback`](org/graalvm/nativeimage/Threading.RecurringCallback.md) (interface): Interface that a callback handler needs to implement. - [`Threading.RecurringCallbackAccess`](org/graalvm/nativeimage/Threading.RecurringCallbackAccess.md) (interface): Provides methods that are available during the execution of a RecurringCallback. ## Methods ### registerRecurringCallback(long, TimeUnit, Threading.RecurringCallback) `@Deprecated(since = "25.1") public static void registerRecurringCallback(long interval, TimeUnit unit, Threading.RecurringCallback callback)`. Since 19.0. Deprecated since 25.1. in 25.1 without replacement. This method is inherently unsafe as it can interfere with other code. This method is intended for expert users. Registers a `callback handler` that is called by the current thread approximately at the provided interval. This functionality is only supported if the native binary is built with `-H:+SupportRecurringCallback`. Note that only carefully crafted, uninterruptible code can execute safely in a recurring callback. Executing any other code easily results in deadlocks, crashes, and difficult-to-debug anomalies. Only one callback can be active per thread. Each thread can have its own callback with a different interval (or none at all). No guarantees are made about the actual interval. For example, when the thread is waiting for a lock or executing native code, no callback can be done. Exceptions that are thrown during the execution of the callback and that are not caught in the callback are ignored. `RecurringCallbackAccess.throwException` can be used to explicitly throw an exception that is not ignored. Specifying `null` for `callback` clears the current thread's callback (in which case, the values of `interval` and `unit` are ignored). Cite: `org/graalvm/nativeimage/Threading.html#registerRecurringCallback(long,java.util.concurrent.TimeUnit,org.graalvm.nativeimage.Threading.RecurringCallback)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◇ Threading.RecurringCallback [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Threading`](org/graalvm/nativeimage/Threading.md). ```java @FunctionalInterface public interface Threading.RecurringCallback ``` Interface that a callback handler needs to implement. ## Methods ### run(Threading.RecurringCallbackAccess) `void run(Threading.RecurringCallbackAccess access)`. Since 19.0. Method that is called recurringly when the callback handler is installed. Cite: `org/graalvm/nativeimage/Threading.RecurringCallback.html#run(org.graalvm.nativeimage.Threading.RecurringCallbackAccess)` # ◇ Threading.RecurringCallbackAccess [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. Nested in [`Threading`](org/graalvm/nativeimage/Threading.md). ```java public interface Threading.RecurringCallbackAccess ``` Provides methods that are available during the execution of a [`RecurringCallback`](org/graalvm/nativeimage/Threading.RecurringCallback.md). ## Methods ### throwException(Throwable) `void throwException(Throwable t)`. Since 19.0. Throws an exception from the recurring callback to the code that is regularly executing in the thread. Cite: `org/graalvm/nativeimage/Threading.RecurringCallbackAccess.html#throwException(java.lang.Throwable)` # ◆ UnmanagedMemory [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class UnmanagedMemory ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `UnmanagedMemory` Contains static methods that allow allocate/free of unmanaged memory, i.e., memory that is not under the control of the garbage collector. In a typical C environment, these are the malloc/free functions of the standard C library, however this class makes no assumptions or guarantees about how the memory is managed. In particular, it is not allowed to free memory returned by these allocation function directly using the standard C library (or vice versa). ## Methods ### malloc(UnsignedWord) `public static T malloc(UnsignedWord size)`. Since 19.0. Allocates `size` bytes of unmanaged memory. The content of the memory is undefined. This method never returns a null pointer, but instead throws an [`OutOfMemoryError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/OutOfMemoryError.html) when allocation fails. Cite: `org/graalvm/nativeimage/UnmanagedMemory.html#malloc(org.graalvm.word.UnsignedWord)` ### malloc(int) `public static T malloc(int size)`. Since 19.0. Allocates `size` bytes of unmanaged memory. The content of the memory is undefined. This method never returns a null pointer, but instead throws an [`OutOfMemoryError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/OutOfMemoryError.html) when allocation fails. Cite: `org/graalvm/nativeimage/UnmanagedMemory.html#malloc(int)` ### calloc(UnsignedWord) `public static T calloc(UnsignedWord size)`. Since 19.0. Allocates `size` bytes of unmanaged memory. The content of the memory is set to 0. This method never returns a null pointer, but instead throws an [`OutOfMemoryError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/OutOfMemoryError.html) when allocation fails. Cite: `org/graalvm/nativeimage/UnmanagedMemory.html#calloc(org.graalvm.word.UnsignedWord)` ### calloc(int) `public static T calloc(int size)`. Since 19.0. Allocates `size` bytes of unmanaged memory. The content of the memory is set to 0. This method never returns a null pointer, but instead throws an [`OutOfMemoryError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/OutOfMemoryError.html) when allocation fails. Cite: `org/graalvm/nativeimage/UnmanagedMemory.html#calloc(int)` ### realloc(T, UnsignedWord) `public static T realloc(T ptr, UnsignedWord size)`. Since 19.0. Changes the size of the provided unmanaged memory to `size` bytes of unmanaged memory. If the new size is larger than the old size, the content of the additional memory is undefined. This method never returns a null pointer, but instead throws an [`OutOfMemoryError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/OutOfMemoryError.html) when allocation fails. In that case, the old data is not deallocated and remains unchanged. Cite: `org/graalvm/nativeimage/UnmanagedMemory.html#realloc(T,org.graalvm.word.UnsignedWord)` ### free(PointerBase) `public static void free(PointerBase ptr)`. Since 19.0. Frees unmanaged memory that was previously allocated using methods of this class. This method is a no-op if the given pointer is `null`. Cite: `org/graalvm/nativeimage/UnmanagedMemory.html#free(org.graalvm.word.PointerBase)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ VMRuntime [nativeimage](index.md) › [org.graalvm.nativeimage](org/graalvm/nativeimage/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage`](org/graalvm/nativeimage/index.md). Since 19.0. ```java public final class VMRuntime ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `VMRuntime` Used for doing VM runtime operations. ## Methods ### initialize() `public static void initialize()`. Since 19.0. Initializes the VM: Runs all startup hooks that were registered during image building. Startup hooks usually depend on option values, so it is recommended (but not required) that all option values are set before calling this method. Invoking this method more than once has no effect, i.e., startup hooks are only executed at the first invocation. Cite: `org/graalvm/nativeimage/VMRuntime.html#initialize()` ### shutdown() `public static void shutdown()`. Since 19.0. Shuts down the VM: Runs all shutdown hooks and waits for all finalization to complete. This method should only be called once. Invoking this method multiple times can have continued effects. Also, although recommended, it is not strictly required for `initialize` to be called before this method. Cite: `org/graalvm/nativeimage/VMRuntime.html#shutdown()` ### dumpHeap(String, boolean) `public static void dumpHeap(String outputFile, boolean live) throws IOException`. Since 20.1. Dumps the heap to the `outputFile` file in the same format as the hprof heap dump. Throws: `UnsupportedOperationException` (unchecked): if this operation is not supported. Cite: `org/graalvm/nativeimage/VMRuntime.html#dumpHeap(java.lang.String,boolean)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ▣ org.graalvm.nativeimage.c [nativeimage](index.md) · Every page: [llms.txt](llms.txt) Package in nativeimage. Since 19.0. This package and its sub-packages provide a fast and lightweight interface between Java code and C code. ## Annotations - [`CContext`](org/graalvm/nativeimage/c/CContext.md): Defines the context for most other annotations of the C interface: the C header files that need to be imported, the C macros that need to be defined to properly configure these headers, and additional flags that should be passed to the C compiler when analyzing the definitions. - [`CHeader`](org/graalvm/nativeimage/c/CHeader.md): Defines the C header file for entry points enclosed by the annotated class or method. # @ CContext [nativeimage](index.md) › [org.graalvm.nativeimage.c](org/graalvm/nativeimage/c/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c`](org/graalvm/nativeimage/c/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({TYPE}) public @interface CContext ``` Defines the context for most other annotations of the C interface: the C header files that need to be imported, the C macros that need to be defined to properly configure these headers, and additional flags that should be passed to the C compiler when analyzing the definitions. ## Nested types - [`CContext.Directives`](org/graalvm/nativeimage/c/CContext.Directives.md) (interface): Describes a C context. ## Elements ### value() `Class value()`. Since 19.0. Specifies which directives are used with the annotated element. Cite: `org/graalvm/nativeimage/c/CContext.html#value()` # ◇ CContext.Directives [nativeimage](index.md) › [org.graalvm.nativeimage.c](org/graalvm/nativeimage/c/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c`](org/graalvm/nativeimage/c/index.md). Since 19.0. Nested in [`CContext`](org/graalvm/nativeimage/c/CContext.md). ```java public interface CContext.Directives ``` Describes a C context. ## Methods ### isInConfiguration() `default boolean isInConfiguration()`. Since 19.0. This method is called immediately after the constructor, to check whether the context is part of the configuration or not. If this method returns false, all elements registered inside this context are ignored. Cite: `org/graalvm/nativeimage/c/CContext.Directives.html#isInConfiguration()` ### getHeaderFiles() `default List getHeaderFiles()`. Since 19.0. All header files used in this context. C allows two kinds of imports: header files can be surrounded with \<...\>, or "...". One of them must be used for every element in the returned list. Cite: `org/graalvm/nativeimage/c/CContext.Directives.html#getHeaderFiles()` ### getMacroDefinitions() `default List getMacroDefinitions()`. Since 19.0. Unparameterized macro-definitions. Each entry is in the form of \ or \ \. Cite: `org/graalvm/nativeimage/c/CContext.Directives.html#getMacroDefinitions()` ### getOptions() `default List getOptions()`. Since 19.0. Returns options to be passed to the C compiler when processing the directives. For example, the option "-Ipath" can be used to add a path for the lookup of header files. Cite: `org/graalvm/nativeimage/c/CContext.Directives.html#getOptions()` ### getLibraries() `default List getLibraries()`. Since 19.0. Returns a collection of libraries. They are treated the same way as libraries added via the `CLibrary` annotation. Cite: `org/graalvm/nativeimage/c/CContext.Directives.html#getLibraries()` ### getLibraryPaths() `default List getLibraryPaths()`. Since 19.0. Returns a list of library paths. Cite: `org/graalvm/nativeimage/c/CContext.Directives.html#getLibraryPaths()` # @ CHeader [nativeimage](index.md) › [org.graalvm.nativeimage.c](org/graalvm/nativeimage/c/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c`](org/graalvm/nativeimage/c/index.md). Since 23.0. ```java @Retention(RUNTIME) @Target({METHOD, TYPE}) public @interface CHeader ``` Defines the C header file for entry points enclosed by the annotated class or method. The `CHeader` annotation can be placed on methods and types: When placed on a method, this method will be included into the defined header file. When placed on a class, all entry points in that class (as well as the enclosing classes) will be included to the defined header file. ## Nested types - [`CHeader.Header`](org/graalvm/nativeimage/c/CHeader.Header.md) (interface): Container for Header file properties. ## Elements ### value() `Class value()`. Since 23.0. Class that defines the header file properties. Cite: `org/graalvm/nativeimage/c/CHeader.html#value()` # ◇ CHeader.Header [nativeimage](index.md) › [org.graalvm.nativeimage.c](org/graalvm/nativeimage/c/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c`](org/graalvm/nativeimage/c/index.md). Since 23.0. Nested in [`CHeader`](org/graalvm/nativeimage/c/CHeader.md). ```java public interface CHeader.Header ``` Container for Header file properties. ## Methods ### name() `String name()`. Since 23.0. Name of the header file. Cite: `org/graalvm/nativeimage/c/CHeader.Header.html#name()` ### dependsOn() `default List> dependsOn()`. Since 23.0. List that contains the `Class` instances that declare dependencies of this header file. Cite: `org/graalvm/nativeimage/c/CHeader.Header.html#dependsOn()` ### writePreamble(PrintWriter) `default void writePreamble(PrintWriter writer)`. Since 23.0. Writes a preamble after the dependencies and before the list of included methods. Cite: `org/graalvm/nativeimage/c/CHeader.Header.html#writePreamble(java.io.PrintWriter)` # ▣ org.graalvm.nativeimage.c.constant [nativeimage](index.md) · Every page: [llms.txt](llms.txt) Package in nativeimage. Since 19.0. This package provides parts of the Java / C interface that are related to C constants. ## Annotations - [`CConstant`](org/graalvm/nativeimage/c/constant/CConstant.md): Denotes a method as a C constant value. - [`CEnum`](org/graalvm/nativeimage/c/constant/CEnum.md): Annotation to import a C enumeration to Java. - [`CEnumConstant`](org/graalvm/nativeimage/c/constant/CEnumConstant.md): Provides additional properties for a field (i.e., an enumeration value) of Java enumeration annotated with CEnum. - [`CEnumLookup`](org/graalvm/nativeimage/c/constant/CEnumLookup.md): Annotation for a method that returns the Java enumeration object for a given C integer value. - [`CEnumValue`](org/graalvm/nativeimage/c/constant/CEnumValue.md): Annotation for a method that returns the C integer value for a Java enumeration object. # @ CConstant [nativeimage](index.md) › [org.graalvm.nativeimage.c.constant](org/graalvm/nativeimage/c/constant/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.constant`](org/graalvm/nativeimage/c/constant/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface CConstant ``` Denotes a method as a C constant value. Calls to the method are replaced with a compile time constant. The constant value is extracted from the C header file during native image generation. The class containing the annotated method must be annotated with [`CContext`](org/graalvm/nativeimage/c/CContext.md). ## Nested types - [`CConstant.ValueAccess`](org/graalvm/nativeimage/c/constant/CConstant.ValueAccess.md) (class): Allows access to the value of a CConstant during image generation. ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the name of the C constant. If no name is provided, the method name is used as the field name. A possible "get" prefix of the method name is removed. Default: `""`. Cite: `org/graalvm/nativeimage/c/constant/CConstant.html#value()` # ◆ CConstant.ValueAccess [nativeimage](index.md) › [org.graalvm.nativeimage.c.constant](org/graalvm/nativeimage/c/constant/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.c.constant`](org/graalvm/nativeimage/c/constant/index.md). Since 19.0. Nested in [`CConstant`](org/graalvm/nativeimage/c/constant/CConstant.md). ```java public final class CConstant.ValueAccess ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `ValueAccess` Allows access to the value of a [`CConstant`](org/graalvm/nativeimage/c/constant/CConstant.md) during image generation. ## Methods ### get(Class, String, Class) `public static T get(Class declaringClass, String methodName, Class returnType)`. Since 19.0. Returns the value of a `CConstant`, i.e., the same value that calling the annotated method would return. This method is useful during native image generation, when the annotated method cannot be called. Parameters: `declaringClass` `Class`: The class that contains the method. `methodName` `String`: The name of the method annotated with `CConstant`. `returnType` `Class`: The desired type of the returned value. For integer-kind constants, the supported types are [`Boolean`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Boolean.html), [`Byte`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Byte.html), [`Short`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Short.html), [`Character`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Character.html), [`Integer`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Integer.html), and [`Long`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Long.html). For floating point constants, the supported types are [`Double`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Double.html) and [`Float`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Float.html). For string constants, the only supported types are [`String`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html) and `byte[]`. Returns `T`: The value of the C constant. Cite: `org/graalvm/nativeimage/c/constant/CConstant.ValueAccess.html#get(java.lang.Class,java.lang.String,java.lang.Class)` ### get(Enum, String) `public static T get(Enum cEnum, String methodName)`. Since 24.2. Returns the value of a `CEnum`, i.e., the same value that calling the method annotated with `CEnumValue` would return. This method is useful during native image generation, when the annotated method cannot be called. Parameters: `cEnum` `Enum`: The enum value for which the C value should be returned. The enum type must be annotated with `CEnum`. `methodName` `String`: The name of the method annotated with `CEnumValue`. Returns `T`: The value of the C constant. Cite: `org/graalvm/nativeimage/c/constant/CConstant.ValueAccess.html#get(java.lang.Enum,java.lang.String)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # @ CEnum [nativeimage](index.md) › [org.graalvm.nativeimage.c.constant](org/graalvm/nativeimage/c/constant/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.constant`](org/graalvm/nativeimage/c/constant/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({TYPE}) public @interface CEnum ``` Annotation to import a C enumeration to Java. In C, enumeration values are plain integer constants. In Java, enumeration values are object constants. Therefore, the Java enumeration value cannot just represent the C value, as it is done for [`CConstant`](org/graalvm/nativeimage/c/constant/CConstant.md). Instead, the Java enumeration with this annotation can define the following methods to convert between C and Java values: - An instance method annotated with [`CEnumValue`](org/graalvm/nativeimage/c/constant/CEnumValue.md) to convert the Java object value to the C integer value. - A static method annotated with [`CEnumLookup`](org/graalvm/nativeimage/c/constant/CEnumLookup.md) to retrieve the Java object value from a C integer value. The Java enumeration values can be annotated with [`CEnumConstant`](org/graalvm/nativeimage/c/constant/CEnumConstant.md) to specify the C enumeration value. This annotation is optional and only needed if an attribute has a non-default value. Note that in C, the keyword "enum" is merely a type-safe way to specify integer constants. Therefore, it is also possible to import C enumeration values as regular [`CConstant`](org/graalvm/nativeimage/c/constant/CConstant.md)s into Java. [`CEnum`](org/graalvm/nativeimage/c/constant/CEnum.md) can also be used to import multiple (potentially unrelated) regular integer C constants into a single Java enumeration. However, please note that each C constant will be converted to the C type that [`CEnum`](org/graalvm/nativeimage/c/constant/CEnum.md) specifies. The annotated class, or an outer class that contains the class, must be annotated with [`CContext`](org/graalvm/nativeimage/c/CContext.md). ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the name of the imported C enum type. If no name is provided, the C data type `int` is used instead. Default: `""`. Cite: `org/graalvm/nativeimage/c/constant/CEnum.html#value()` ### addEnumKeyword() `boolean addEnumKeyword() default false`. Since 19.0. Add the C `enum` keyword to the name specified in `value()`. Default: `false`. Cite: `org/graalvm/nativeimage/c/constant/CEnum.html#addEnumKeyword()` # @ CEnumConstant [nativeimage](index.md) › [org.graalvm.nativeimage.c.constant](org/graalvm/nativeimage/c/constant/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.constant`](org/graalvm/nativeimage/c/constant/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({FIELD}) public @interface CEnumConstant ``` Provides additional properties for a field (i.e., an enumeration value) of Java enumeration annotated with [`CEnum`](org/graalvm/nativeimage/c/constant/CEnum.md). ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the name of the imported C enum constant. Default: `""`. Cite: `org/graalvm/nativeimage/c/constant/CEnumConstant.html#value()` ### includeInLookup() `boolean includeInLookup() default true`. Since 19.0. Specifies whether the annotated enumeration value is returned by the lookup method annotated with `CEnumLookup`. Default: `true`. Cite: `org/graalvm/nativeimage/c/constant/CEnumConstant.html#includeInLookup()` # @ CEnumLookup [nativeimage](index.md) › [org.graalvm.nativeimage.c.constant](org/graalvm/nativeimage/c/constant/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.constant`](org/graalvm/nativeimage/c/constant/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface CEnumLookup ``` Annotation for a method that returns the Java enumeration object for a given C integer value. The method must be within a class annotated with [`CEnum`](org/graalvm/nativeimage/c/constant/CEnum.md). The method must be declared static, native, and must have exactly one parameter (the C value that is to be looked up). The method can have any name. The Java enumeration can have multiple values with the same C value. However, in that case one Java value must be selected manually using the attribute [`CEnumConstant.includeInLookup()`](org/graalvm/nativeimage/c/constant/CEnumConstant.md#includeInLookup%28%29). All but one Java values must have this attribute set to `false`. # @ CEnumValue [nativeimage](index.md) › [org.graalvm.nativeimage.c.constant](org/graalvm/nativeimage/c/constant/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.constant`](org/graalvm/nativeimage/c/constant/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface CEnumValue ``` Annotation for a method that returns the C integer value for a Java enumeration object. The method must be within a class annotated with [`CEnum`](org/graalvm/nativeimage/c/constant/CEnum.md). The method must be declared non-static, native, and must not have any parameters. The method can have any name. # ▣ org.graalvm.nativeimage.c.function [nativeimage](index.md) · Every page: [llms.txt](llms.txt) Package in nativeimage. Since 19.0. This package provides parts of the Java / C interface that are related to C functions. ## Interfaces - [`CFunctionPointer`](org/graalvm/nativeimage/c/function/CFunctionPointer.md): Base interface for all function pointers. - [`CodePointer`](org/graalvm/nativeimage/c/function/CodePointer.md): Pointer to executable code. - [`RelocatedPointer`](org/graalvm/nativeimage/c/function/RelocatedPointer.md): A pointer which is relocated when the native image is loaded at runtime. ## Classes - [`CEntryPointLiteral`](org/graalvm/nativeimage/c/function/CEntryPointLiteral.md): A function pointer to an entry point method that can be, for example, handed out to C code so that C code can call back into Java code. ## Annotations - [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md): Annotates a method that is a VM entry point. - [`CFunction`](org/graalvm/nativeimage/c/function/CFunction.md): Denotes a native method that calls directly from Java to C, without following the JNI protocol. - [`CLibrary`](org/graalvm/nativeimage/c/function/CLibrary.md): Denotes an external library that needs to be linked in. - [`CMacroInfo`](org/graalvm/nativeimage/c/function/CMacroInfo.md): Informational only. - [`InvokeCFunctionPointer`](org/graalvm/nativeimage/c/function/InvokeCFunctionPointer.md): Annotation for an invocation method defined in a sub-interface of CFunctionPointer. # @ CEntryPoint [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface CEntryPoint ``` Annotates a method that is a VM entry point. Such a method must be declared *static*, and is made accessible so that it can be called as a C function using the native ABI. An execution context must be passed as an [`IsolateThread`](org/graalvm/nativeimage/IsolateThread.md) that is specific to the current thread. This pointer can be obtained via [`CurrentIsolate.getCurrentThread()`](org/graalvm/nativeimage/CurrentIsolate.md#getCurrentThread%28%29). When there is more than one parameter of [`IsolateThread`](org/graalvm/nativeimage/IsolateThread.md), exactly one of the parameters must be annotated with [`IsolateThreadContext`](org/graalvm/nativeimage/c/function/CEntryPoint.IsolateThreadContext.md). Exceptions cannot be thrown to the caller and must be explicitly caught in the entry point method. Any uncaught exception causes the termination of the process after it is printed. No object types are permitted for parameters or return types; only primitive Java values, [`word`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html) values, and enum values are allowed. Enum values are automatically converted from integer constants to Java enum object constants. The enum class must have a [`CEnum`](org/graalvm/nativeimage/c/constant/CEnum.md) annotation. When enum values are passed as parameters, the enum class must have a method with a [`CEnumLookup`](org/graalvm/nativeimage/c/constant/CEnumLookup.md) annotation. For enum return types, the enum class must have a method that is annotated with [`CEnumValue`](org/graalvm/nativeimage/c/constant/CEnumValue.md). ## Nested types - [`CEntryPoint.AlwaysIncluded`](org/graalvm/nativeimage/c/function/CEntryPoint.AlwaysIncluded.md) (class): A BooleanSupplier that always returns true. - [`CEntryPoint.Builtin`](org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.md) (enum class): The built-in methods which can be aliased. - [`CEntryPoint.ExceptionHandler`](org/graalvm/nativeimage/c/function/CEntryPoint.ExceptionHandler.md) (interface): Marker interface for all exception handler classes. - [`CEntryPoint.FatalExceptionHandler`](org/graalvm/nativeimage/c/function/CEntryPoint.FatalExceptionHandler.md) (class): Special placeholder value for exceptionHandler() to print the caught exception and treat it as a fatal error. - [`CEntryPoint.IsolateContext`](org/graalvm/nativeimage/c/function/CEntryPoint.IsolateContext.md) (annotation interface): Designates an Isolate parameter to use as the execution context. - [`CEntryPoint.IsolateThreadContext`](org/graalvm/nativeimage/c/function/CEntryPoint.IsolateThreadContext.md) (annotation interface): Designates an IsolateThread parameter to use as the execution context. - [`CEntryPoint.NotIncludedAutomatically`](org/graalvm/nativeimage/c/function/CEntryPoint.NotIncludedAutomatically.md) (class): A BooleanSupplier that always returns false. - [`CEntryPoint.Publish`](org/graalvm/nativeimage/c/function/CEntryPoint.Publish.md) (enum class): No description. ## Elements ### name() `String name() default ""`. Since 19.0. The symbol name to use for this entry point. Default: `""`. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.html#name()` ### documentation() `String[] documentation() default {""}`. Since 19.0. Method documentation to be included in the header file, as an array of lines. Default: `{""}`. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.html#documentation()` ### exceptionHandler() `Class exceptionHandler() default org.graalvm.nativeimage.c.function.CEntryPoint.FatalExceptionHandler.class`. Since 19.0. Provides an exception handler for all exceptions that are not handled explicitly by the entry point method. Java exceptions cannot be passed back to C code. If this property is not set, any uncaught exception is treated as a `fatal error`. The provided class must have exactly one declared method (the exception handler method). The method must be static, have one parameter of type [`Throwable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Throwable.html) or [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html), and must have a return type that is assignable to the return type of the annotated entry point method. That exception handler method is invoked when an exception reaches the entry point, and the exception is passed as the argument. The return value of the exception handler method is then the return value of the entry point, i.e., passed back to the C code. Default: `org.graalvm.nativeimage.c.function.CEntryPoint.FatalExceptionHandler.class`. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.html#exceptionHandler()` ### builtin() `CEntryPoint.Builtin builtin() default NO_BUILTIN`. Since 19.0. Specifies that the annotated entry point method is an alias for a built-in function as provided by the C API. Such aliases may have extra arguments which are ignored and can be used to adhere to specific external conventions. The annotated method must be declared `native` and as such, cannot have its own code body. Refer to the C API for descriptions of the built-ins, and to the individual built-ins for their requirements to the annotated method's signature. Default: `NO_BUILTIN`. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.html#builtin()` ### include() `Class include() default org.graalvm.nativeimage.c.function.CEntryPoint.AlwaysIncluded.class`. Since 22.0. If the supplier returns `true`, this entry point is added automatically when building a shared library. This means the method is a root method for compilation, and everything reachable from it is compiled too. The provided class must have a nullary constructor, which is used to instantiate the class. Then the supplier function is called on the newly instantiated instance. Default: `org.graalvm.nativeimage.c.function.CEntryPoint.AlwaysIncluded.class`. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.html#include()` ### publishAs() `CEntryPoint.Publish publishAs() default SymbolAndHeader`. Since 22.0. Whether the entry point is part of the symbols and header files produced by Native Image. Default: `SymbolAndHeader`. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.html#publishAs()` # ◆ CEntryPoint.AlwaysIncluded [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 22.0. Nested in [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md). ```java public final class CEntryPoint.AlwaysIncluded implements BooleanSupplier ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `AlwaysIncluded` Implements: [`BooleanSupplier`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/BooleanSupplier.html) A [`BooleanSupplier`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/BooleanSupplier.html) that always returns `true`. ## Methods ### getAsBoolean() `public boolean getAsBoolean()`. Since 22.0. Returns `true`. Overrides `getAsBoolean()`. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.AlwaysIncluded.html#getAsBoolean()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ≡ CEntryPoint.Builtin [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Enum class in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. Nested in [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md). ```java public enum CEntryPoint.Builtin ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > [`Enum`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html) > `Builtin` The built-in methods which can be [aliased](org/graalvm/nativeimage/c/function/CEntryPoint.md#builtin%28%29). ## Enum constants ### NO_BUILTIN `NO_BUILTIN`. Since 19.0. The annotated method is not an alias for a built-in method. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.html#NO_BUILTIN` ### CREATE_ISOLATE `CREATE_ISOLATE`. Since 19.0. The annotated method creates an isolate. An alias for this built-in requires no arguments, and must have a return type of `IsolateThread`. In case of an error, [`NULL`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordFactory.html#nullPointer%28%29) is returned. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.html#CREATE_ISOLATE` ### ATTACH_THREAD `ATTACH_THREAD`. Since 19.0. The annotated method attaches the current thread to an isolate. It requires a parameter of type `Isolate` with the isolate to attach to, and a return type of `IsolateThread`. In case of an error, [`NULL`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordFactory.html#nullPointer%28%29) is returned. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.html#ATTACH_THREAD` ### GET_CURRENT_THREAD `GET_CURRENT_THREAD`. Since 19.0. The annotated method returns the `IsolateThread` of the current thread in a specified `Isolate`. It requires a parameter of type `Isolate` for the isolate in question, and a return type of `IsolateThread`. In case of an error or if the current thread is not attached to the specified isolate, [`NULL`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordFactory.html#nullPointer%28%29) is returned. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.html#GET_CURRENT_THREAD` ### GET_ISOLATE `GET_ISOLATE`. Since 19.0. The annotated method returns the `Isolate` for an `IsolateThread`. It requires a parameter of type `IsolateThread`, and a return type of `Isolate`. In case of an error, [`NULL`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordFactory.html#nullPointer%28%29) is returned. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.html#GET_ISOLATE` ### DETACH_THREAD `DETACH_THREAD`. Since 19.0. The annotated method detaches the current thread, given as an `IsolateThread`, from an isolate. It requires a parameter of type `IsolateThread`, and a return type of `int` or `void`. With an `int` return type, zero is returned when successful, or non-zero in case of an error. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.html#DETACH_THREAD` ### TEAR_DOWN_ISOLATE `TEAR_DOWN_ISOLATE`. Since 19.0. The annotated method tears down the specified isolate. It requires a parameter of type `IsolateThread`, and a return type of `int` or `void`. With an `int` return type, zero is returned when successful, or non-zero in case of an error. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.html#TEAR_DOWN_ISOLATE` ## Methods ### values() `public static CEntryPoint.Builtin[] values()`. Returns the enum constants in declaration order. Returns `CEntryPoint.Builtin[]`: Returns the enum constants in declaration order. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.html#values()` ### valueOf(String) `public static CEntryPoint.Builtin valueOf(String name)`. Returns the enum constant with the given name. Parameters: `name` `String`: The exact name of the enum constant. Returns `CEntryPoint.Builtin`: Returns the enum constant with the given name. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Builtin.html#valueOf(java.lang.String)` ## Inherited members - From class [`Enum`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html): [`compareTo`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#compareTo%28E%29), [`describeConstable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#describeConstable%28%29), [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#equals%28java.lang.Object%29), [`getDeclaringClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#getDeclaringClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#hashCode%28%29), [`name`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#name%28%29), [`ordinal`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#ordinal%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#toString%28%29), [`valueOf`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#valueOf%28java.lang.Class,java.lang.String%29) - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◇ CEntryPoint.ExceptionHandler [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 22.0. Nested in [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md). ```java public interface CEntryPoint.ExceptionHandler ``` Marker interface for all [`exception handler`](org/graalvm/nativeimage/c/function/CEntryPoint.md#exceptionHandler%28%29) classes. # ◆ CEntryPoint.FatalExceptionHandler [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. Nested in [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md). ```java public final class CEntryPoint.FatalExceptionHandler implements CEntryPoint.ExceptionHandler ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `FatalExceptionHandler` Implements: [`CEntryPoint.ExceptionHandler`](org/graalvm/nativeimage/c/function/CEntryPoint.ExceptionHandler.md) Special placeholder value for [`exceptionHandler()`](org/graalvm/nativeimage/c/function/CEntryPoint.md#exceptionHandler%28%29) to print the caught exception and treat it as a [`fatal error`](org/graalvm/nativeimage/LogHandler.md#fatalError%28%29). ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # @ CEntryPoint.IsolateContext [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. Nested in [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md). ```java @Retention(RUNTIME) @Target({PARAMETER}) public @interface CEntryPoint.IsolateContext ``` Designates an [`Isolate`](org/graalvm/nativeimage/Isolate.md) parameter to use as the execution context. At most one parameter can be annotated with this annotation or [`IsolateThreadContext`](org/graalvm/nativeimage/c/function/CEntryPoint.IsolateThreadContext.md). # @ CEntryPoint.IsolateThreadContext [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. Nested in [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md). ```java @Retention(RUNTIME) @Target({PARAMETER}) public @interface CEntryPoint.IsolateThreadContext ``` Designates an [`IsolateThread`](org/graalvm/nativeimage/IsolateThread.md) parameter to use as the execution context. At most one parameter can be annotated with this annotation or [`IsolateContext`](org/graalvm/nativeimage/c/function/CEntryPoint.IsolateContext.md). # ◆ CEntryPoint.NotIncludedAutomatically [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 22.0. Nested in [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md). ```java public final class CEntryPoint.NotIncludedAutomatically implements BooleanSupplier ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `NotIncludedAutomatically` Implements: [`BooleanSupplier`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/BooleanSupplier.html) A [`BooleanSupplier`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/BooleanSupplier.html) that always returns `false`. ## Methods ### getAsBoolean() `public boolean getAsBoolean()`. Since 22.0. Returns `false`. Overrides `getAsBoolean()`. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.NotIncludedAutomatically.html#getAsBoolean()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ≡ CEntryPoint.Publish [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Enum class in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 22.0. Nested in [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md). ```java public enum CEntryPoint.Publish ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > [`Enum`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html) > `Publish` ## Enum constants ### NotPublished `NotPublished`. Do not publish the entry point method. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Publish.html#NotPublished` ### SymbolOnly `SymbolOnly`. Create a symbol for the entry point method in the native image. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Publish.html#SymbolOnly` ### SymbolAndHeader `SymbolAndHeader`. Create a symbol for the entry point method in the native image, and if building a shared library image, also include a C declaration in the generated C header file. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Publish.html#SymbolAndHeader` ## Methods ### values() `public static CEntryPoint.Publish[] values()`. Returns the enum constants in declaration order. Returns `CEntryPoint.Publish[]`: Returns the enum constants in declaration order. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Publish.html#values()` ### valueOf(String) `public static CEntryPoint.Publish valueOf(String name)`. Returns the enum constant with the given name. Parameters: `name` `String`: The exact name of the enum constant. Returns `CEntryPoint.Publish`: Returns the enum constant with the given name. Cite: `org/graalvm/nativeimage/c/function/CEntryPoint.Publish.html#valueOf(java.lang.String)` ## Inherited members - From class [`Enum`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html): [`compareTo`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#compareTo%28E%29), [`describeConstable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#describeConstable%28%29), [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#equals%28java.lang.Object%29), [`getDeclaringClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#getDeclaringClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#hashCode%28%29), [`name`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#name%28%29), [`ordinal`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#ordinal%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#toString%28%29), [`valueOf`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#valueOf%28java.lang.Class,java.lang.String%29) - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ CEntryPointLiteral [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. ```java public final class CEntryPointLiteral ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `CEntryPointLiteral` A function pointer to an [`entry point method`](org/graalvm/nativeimage/c/function/CEntryPoint.md) that can be, for example, handed out to C code so that C code can call back into Java code. The method that is referred to must be annotated with [`CEntryPoint`](org/graalvm/nativeimage/c/function/CEntryPoint.md), which imposes certain restrictions. The actual value of the function pointer is only available at run time. To prevent accidental access to it during native image generation, the actual [`function pointer`](org/graalvm/nativeimage/c/function/CEntryPointLiteral.md#getFunctionPointer%28%29) is encapsulated in this class. The call to [`getFunctionPointer()`](org/graalvm/nativeimage/c/function/CEntryPointLiteral.md#getFunctionPointer%28%29) fails with an exception during native image generation. Instances of this class can only be created during native image generation. It is not possible to look up a function by name at run time. The intended use case is therefore as follows: ```java // Function that is externally accessible @CEntryPoint static int myFunction(IsolateThread thread, int x, int y) { ... } // Invocation interface (for calls from Java, otherwise CFunctionPointer suffices) interface MyFunctionPointer extends CFunctionPointer { @InvokeCFunctionPointer int invoke(IsolateThread thread, int x, int y); } // Function pointer literal public static final CEntryPointLiteral myFunctionLiteral = CEntryPointLiteral.create(MyClass.class, "myFunction", new Class[]{IsolateThread.class, int.class, int.class}); // Call from Java void caller() { MyFunctionPointer fp = myFunctionLiteral.getFunctionPointer(); // entry point, could be returned to C code int fiftyeight = fp.invoke(CurrentIsolate.getCurrentThread(), 47, 11); } ``` ## Methods ### create(Class, String, Class...) `public static CEntryPointLiteral create(Class definingClass, String methodName, Class... parameterTypes)`. Since 19.0. Creates a new function pointer to an entry point. Cite: `org/graalvm/nativeimage/c/function/CEntryPointLiteral.html#create(java.lang.Class,java.lang.String,java.lang.Class...)` ### getFunctionPointer() `public T getFunctionPointer()`. Since 19.0. Returns the function pointer to the entry point. Cite: `org/graalvm/nativeimage/c/function/CEntryPointLiteral.html#getFunctionPointer()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # @ CFunction [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface CFunction ``` Denotes a `native` method that calls directly from Java to C, without following the JNI protocol. This means that there are no artificial additional parameters such as the JNI environment passed, and no marshaling or processing of arguments (such as creating handles for objects) is performed. If the method is non-static, the receiver will be ignored. Parameter types and return types must not be Java reference types, only [primitive](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#isPrimitive%28%29) Java types, [word types](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html) and [`CEnum`](org/graalvm/nativeimage/c/constant/CEnum.md) types are allowed. The representation of passed primitive values matches exactly how they are specified in the Java language, for example, `int` as a 32-bit signed integer or `char` as a 16-bit unsigned integer. `boolean` is specified as a single byte that corresponds to `true` if non-zero, and to `false` if zero. If a Word value is passed that points to a Java object, no guarantees are taken regarding its integrity as a pointer. The class containing the annotated method must be annotated with [`CContext`](org/graalvm/nativeimage/c/CContext.md). Note that this annotation must not be used for native functions that use variadic arguments (varargs) because varargs calling conventions are not supported and even a declaration with a specific non-varargs signature can be incompatible with vararg target functions on some platforms. ## Nested types - [`CFunction.Transition`](org/graalvm/nativeimage/c/function/CFunction.Transition.md) (enum class): Describes the thread state transition performed when the C function is invoked. ## Elements ### value() `String value() default ""`. Since 19.0. The symbol name to use to link this method. If no value is specified, the name of the method (without name mangling or a class name prefix) is used. Default: `""`. Cite: `org/graalvm/nativeimage/c/function/CFunction.html#value()` ### transition() `CFunction.Transition transition() default TO_NATIVE`. Since 19.0. The Java-to-C thread transition code used when calling the function. Default: `TO_NATIVE`. Cite: `org/graalvm/nativeimage/c/function/CFunction.html#transition()` # ≡ CFunction.Transition [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Enum class in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. Nested in [`CFunction`](org/graalvm/nativeimage/c/function/CFunction.md). ```java public enum CFunction.Transition ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > [`Enum`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html) > `Transition` Describes the thread state transition performed when the C function is invoked. ## Enum constants ### TO_NATIVE `TO_NATIVE`. Since 19.0. The thread state is transitioned from Java to C, and the Java parts of the stack are made walkable. The C code can block and call back to Java. Cite: `org/graalvm/nativeimage/c/function/CFunction.Transition.html#TO_NATIVE` ### NO_TRANSITION `NO_TRANSITION`. Since 19.0. No prologue and epilogue is emitted. The C code must not block and must not call back to Java. Also, long running C code delays safepoints (and therefore garbage collection) of other threads until the call returns. Cite: `org/graalvm/nativeimage/c/function/CFunction.Transition.html#NO_TRANSITION` ## Methods ### values() `public static CFunction.Transition[] values()`. Returns the enum constants in declaration order. Returns `CFunction.Transition[]`: Returns the enum constants in declaration order. Cite: `org/graalvm/nativeimage/c/function/CFunction.Transition.html#values()` ### valueOf(String) `public static CFunction.Transition valueOf(String name)`. Returns the enum constant with the given name. Parameters: `name` `String`: The exact name of the enum constant. Returns `CFunction.Transition`: Returns the enum constant with the given name. Cite: `org/graalvm/nativeimage/c/function/CFunction.Transition.html#valueOf(java.lang.String)` ## Inherited members - From class [`Enum`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html): [`compareTo`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#compareTo%28E%29), [`describeConstable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#describeConstable%28%29), [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#equals%28java.lang.Object%29), [`getDeclaringClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#getDeclaringClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#hashCode%28%29), [`name`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#name%28%29), [`ordinal`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#ordinal%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#toString%28%29), [`valueOf`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Enum.html#valueOf%28java.lang.Class,java.lang.String%29) - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◇ CFunctionPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. ```java public interface CFunctionPointer extends CodePointer, RelocatedPointer ``` Extends: [`CodePointer`](org/graalvm/nativeimage/c/function/CodePointer.md), [`RelocatedPointer`](org/graalvm/nativeimage/c/function/RelocatedPointer.md) Base interface for all function pointers. Sub-interfaces define methods annotated with [`InvokeCFunctionPointer`](org/graalvm/nativeimage/c/function/InvokeCFunctionPointer.md) that invoke the method referenced by this function pointer. Since the signature of the invocation method is not known, it is not possible to define a single generic invocation method here. ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # @ CLibrary [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({TYPE, METHOD}) public @interface CLibrary ``` Denotes an external library that needs to be linked in. The annotation can be placed on any element, and the same library can be referenced by multiple annotations. ## Elements ### value() `String value()`. Since 19.0. The name of the library without a file extension (e.g., "hello"). The name of the actual file is platform-specific, e.g., `libhello.so` on Linux, `libhello.dylib` on macOS, and `hello.dll` on Windows. Cite: `org/graalvm/nativeimage/c/function/CLibrary.html#value()` ### requireStatic() `boolean requireStatic() default false`. Since 19.1.0. Specifies if static linking is required. Default: `false`. Cite: `org/graalvm/nativeimage/c/function/CLibrary.html#requireStatic()` ### dependsOn() `String[] dependsOn() default {}`. Since 20.1.0. Specifies the name of the libraries this library depends on. Default: `{}`. Cite: `org/graalvm/nativeimage/c/function/CLibrary.html#dependsOn()` # @ CMacroInfo [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. ```java @Retention(SOURCE) @Target({METHOD}) public @interface CMacroInfo ``` Informational only. Used to annotate a method that implements features implemented by a macro in C. There is no automatic way to translate a C macro to equivalent Java code. Therefore, the body of the annotated method must be written manually, and updated manually when the C macro changes. ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the name of the C macro the annotated method corresponds to. Default: `""`. Cite: `org/graalvm/nativeimage/c/function/CMacroInfo.html#value()` # ◇ CodePointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. ```java public interface CodePointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) Pointer to executable code. This interface exists mainly to improve static type checking, i.e., to prevent mixing code pointers and non-code pointers by accident. ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # @ InvokeCFunctionPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface InvokeCFunctionPointer ``` Annotation for an invocation method defined in a sub-interface of [`CFunctionPointer`](org/graalvm/nativeimage/c/function/CFunctionPointer.md). The method is called with C calling conventions. See [`CFunction`](org/graalvm/nativeimage/c/function/CFunction.md) for more details on the invocation. ## Elements ### transition() `CFunction.Transition transition() default TO_NATIVE`. Since 19.0. The Java-to-C thread transition code used when calling the function. Default: `TO_NATIVE`. Cite: `org/graalvm/nativeimage/c/function/InvokeCFunctionPointer.html#transition()` # ◇ RelocatedPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.function](org/graalvm/nativeimage/c/function/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.function`](org/graalvm/nativeimage/c/function/index.md). Since 19.0. ```java public interface RelocatedPointer extends ComparableWord ``` Extends: [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html) A pointer which is relocated when the native image is loaded at runtime. Relocation entries are created for such pointers in the native image. As a consequence, the value of a [`RelocatedPointer`](org/graalvm/nativeimage/c/function/RelocatedPointer.md) is not known at native image generation. ## Inherited members - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ▣ org.graalvm.nativeimage.c.struct [nativeimage](index.md) · Every page: [llms.txt](llms.txt) Package in nativeimage. Since 19.0. This package provides parts of the Java / C interface that are related to C structures. ## Classes - [`SizeOf`](org/graalvm/nativeimage/c/struct/SizeOf.md): Contains static methods that provide access to the size of dereferenced SystemJava pointer types (i.e. ## Annotations - [`AllowNarrowingCast`](org/graalvm/nativeimage/c/struct/AllowNarrowingCast.md): Allows a method annotated with CField to have a value type that is narrower (smaller number of bits) than the C type. - [`AllowWideningCast`](org/graalvm/nativeimage/c/struct/AllowWideningCast.md): Allows a method annotated with CField to have a value type that is wider (larger number of bits) than the C type. - [`CBitfield`](org/graalvm/nativeimage/c/struct/CBitfield.md): Denotes a method as a bitfield access of a C struct. - [`CField`](org/graalvm/nativeimage/c/struct/CField.md): Denotes a method as a field access of a C struct. - [`CFieldAddress`](org/graalvm/nativeimage/c/struct/CFieldAddress.md): Denotes a method as a field address computation of a C struct. - [`CFieldOffset`](org/graalvm/nativeimage/c/struct/CFieldOffset.md): Denotes a method as a field offset access of a C struct. - [`CPointerTo`](org/graalvm/nativeimage/c/struct/CPointerTo.md): Denotes Java interface that imports a C pointer type. - [`CStruct`](org/graalvm/nativeimage/c/struct/CStruct.md): Denotes Java interface that imports a C struct. - [`CTypedefOfInfo`](org/graalvm/nativeimage/c/struct/CTypedefOfInfo.md): Informational only. - [`RawField`](org/graalvm/nativeimage/c/struct/RawField.md): Denotes a method as a field access of a structured C memory. - [`RawFieldAddress`](org/graalvm/nativeimage/c/struct/RawFieldAddress.md): Denotes a method as a field address computation of a RawStructure. - [`RawFieldOffset`](org/graalvm/nativeimage/c/struct/RawFieldOffset.md): Denotes a method as a field offset access of a RawStructure. - [`RawPointerTo`](org/graalvm/nativeimage/c/struct/RawPointerTo.md): Denotes a Java interface that is a pointer to a RawStructure. - [`RawStructure`](org/graalvm/nativeimage/c/struct/RawStructure.md): Denotes Java interface that represents C memory, but without a C struct definition. - [`UniqueLocationIdentity`](org/graalvm/nativeimage/c/struct/UniqueLocationIdentity.md): A CField also annotated with this annotation gets a unique LocationIdentity assigned, i.e., reads and writes do not interfere with reads and writes to any other field and are optimized without regarding other fields. # @ AllowNarrowingCast [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface AllowNarrowingCast ``` Allows a method annotated with [`CField`](org/graalvm/nativeimage/c/struct/CField.md) to have a value type that is narrower (smaller number of bits) than the C type. # @ AllowWideningCast [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface AllowWideningCast ``` Allows a method annotated with [`CField`](org/graalvm/nativeimage/c/struct/CField.md) to have a value type that is wider (larger number of bits) than the C type. # @ CBitfield [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface CBitfield ``` Denotes a method as a bitfield access of a [`C struct`](org/graalvm/nativeimage/c/struct/CStruct.md). If the method has a non-void return type, it is a get-method of the field. Calls of the method are replaced with a memory read. The possible signatures are `FieldType getFieldName([LocationIdentity locationIdentity]);` If the method has the return type void, it is a set-method of the field. Calls of the method are replaced with memory accesses. The possible signatures are `void setFieldName(FieldType value, [LocationIdentity locationIdentity]);` Most architectures do not provide write instructions on the bit-level. Therefore, the memory write of the new value is preceded by a memory read of the old value. This makes bitfield writes non-atomic. The receiver is the pointer to the struct that is accessed, i.e., the base address of the memory access. The `FieldType` must be a primitive integer type or a [`word type`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html). The optional parameter `locationIdentity` specifies the [`LocationIdentity`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/LocationIdentity.html) to be used for the memory access. Two memory accesses with two different location identities are guaranteed to not alias. Note that [`UniqueLocationIdentity`](org/graalvm/nativeimage/c/struct/UniqueLocationIdentity.md) annotation, cannot be used on bitfields. Multiple accessor methods, with different signatures according to the rules of allowed signatures, are allowed for a single field. ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the field name inside the `C struct`. If no name is provided, the method name is used as the field name. A possible "get" or "set" prefix of the method name is removed. Default: `""`. Cite: `org/graalvm/nativeimage/c/struct/CBitfield.html#value()` # @ CField [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface CField ``` Denotes a method as a field access of a [`C struct`](org/graalvm/nativeimage/c/struct/CStruct.md). If the method has a non-void return type, it is a get-method of the field. Calls of the method are replaced with a memory read. The possible signatures are `FieldType getFieldName([IntType index], [LocationIdentity locationIdentity]);` If the method has the return type void, it is a set-method of the field. Calls of the method are replaced with a memory write. The possible signatures are `void setFieldName([IntType index], FieldType value, [LocationIdentity locationIdentity]);` The receiver is the pointer to the struct that is accessed, i.e., the base address of the memory access. The `FieldType` must be the Java-equivalent of the C type used in the C struct. The additional annotations [`AllowNarrowingCast`](org/graalvm/nativeimage/c/struct/AllowNarrowingCast.md) or [`AllowWideningCast`](org/graalvm/nativeimage/c/struct/AllowWideningCast.md) can be used to relax the strict type requirements. The optional parameter `index` (always the first parameter when it is present) denotes an index, i.e., the receiver is treated as an array of the struct. The type must be a primitive integer type or a [`word type`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html). Address arithmetic is used to scale the index with the size of the struct. The optional parameter `locationIdentity` specifies the [`LocationIdentity`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/LocationIdentity.html) to be used for the memory access. Two memory accesses with two different location identities are guaranteed to not alias. The parameter cannot be used together with the [`UniqueLocationIdentity`](org/graalvm/nativeimage/c/struct/UniqueLocationIdentity.md) annotation, which is another way of providing a location identity for the memory access. Multiple accessor methods, with different signatures according to the rules of allowed signatures, are allowed for a single field. ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the field name inside the `C struct`. If no name is provided, the method name is used as the field name. A possible "get" or "set" prefix of the method name is removed. Default: `""`. Cite: `org/graalvm/nativeimage/c/struct/CField.html#value()` # @ CFieldAddress [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface CFieldAddress ``` Denotes a method as a field address computation of a [`C struct`](org/graalvm/nativeimage/c/struct/CStruct.md). Calls to the method are replaced with address arithmetic. The possible signatures are `IntType addressOfFieldName([IntType index]);` The return type must be a primitive integer type or a [`word type`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html). The receiver is the pointer to the struct that is accessed The field offset, i.e., the value that is added to the receiver, is a compile time constant. ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the field name inside the `C struct`. If no name is provided, the method name is used as the field name. A possible "addressOf" prefix of the method name is removed. Default: `""`. Cite: `org/graalvm/nativeimage/c/struct/CFieldAddress.html#value()` # @ CFieldOffset [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface CFieldOffset ``` Denotes a method as a field offset access of a [`C struct`](org/graalvm/nativeimage/c/struct/CStruct.md). The method must not have any parameters. The return type must be a primitive integer type or a [`word type`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html). Calls to the method are replaced with a compile time constant. If the annotation is used on a non-static method, the receiver is ignored. Java does not allow an interface method to be declared `static native`. So the annotated method must either be non-static (with the receiver being ignored), or static but non-native (with the method body being ignored). ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the field name inside the `C struct`. If no name is provided, the method name is used as the field name. A possible "offsetOf" prefix of the method name is removed. Default: `""`. Cite: `org/graalvm/nativeimage/c/struct/CFieldOffset.html#value()` # @ CPointerTo [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({TYPE}) public @interface CPointerTo ``` Denotes Java interface that imports a C pointer type. The interface must extend [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html), i.e., it is a word type. There is never a Java class that implements the interface. If the method has a non-void return type that is not the annotated interface, it is a read-method of the pointer. Calls of the method are replaced with a memory read. The possible signatures are `ValueType read([IntType index], [LocationIdentity locationIdentity]);` If the method has the return type void, it is a write-method of the pointer. Calls of the method are replaced with a memory write. The possible signatures are `void write([IntType index], ValueType value, [LocationIdentity locationIdentity]);` If the return type of the method is the annotated interface, it is an address computation for an array access. Calls of the method are replaced with address arithmetic. The possible signatures are `PointerType addressOf(IntType index);` The receiver is the pointer that is accessed, i.e., the base address of the memory access. The `ValueType` must be the Java-equivalent of the C type used in the pointer definition. The optional parameter `index` (always the first parameter when it is present) denotes an index, i.e., the receiver is treated as an array of the pointers. The type must be a primitive integer type or a [`word type`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html). Address arithmetic is used to scale the index with the size of the value type. The optional parameter `locationIdentity` specifies the [`LocationIdentity`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/LocationIdentity.html) to be used for the memory access. Two memory accesses with two different location identities are guaranteed to not alias. The parameter cannot be used together with the [`UniqueLocationIdentity`](org/graalvm/nativeimage/c/struct/UniqueLocationIdentity.md) annotation, which is another way of providing a location identity for the memory access. ## Elements ### value() `Class value() default org.graalvm.word.WordBase.class`. Since 19.0. The value type, as a reference to a Java interface that is either annotated with `CStruct` or `CPointerTo`. Exactly one of the properties `value()` and `CPointerTo.nameOfCType()` must be specified. Default: `org.graalvm.word.WordBase.class`. Cite: `org/graalvm/nativeimage/c/struct/CPointerTo.html#value()` ### nameOfCType() `String nameOfCType() default ""`. Since 19.0. The value type, as C type name. Exactly one of the properties `value()` and `CPointerTo.nameOfCType()` must be specified. Default: `""`. Cite: `org/graalvm/nativeimage/c/struct/CPointerTo.html#nameOfCType()` # @ CStruct [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({TYPE}) public @interface CStruct ``` Denotes Java interface that imports a C struct. The interface must extend [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html), i.e., it is a word type. There is never a Java class that implements the interface. Field accesses are done via interface methods that are annotated with [`CField`](org/graalvm/nativeimage/c/struct/CField.md), [`CFieldAddress`](org/graalvm/nativeimage/c/struct/CFieldAddress.md), or [`CFieldOffset`](org/graalvm/nativeimage/c/struct/CFieldOffset.md). All calls of the interface methods are replaced with the appropriate memory or address arithmetic operations. Here is an example to define a complex number structure: ```java @CStruct interface ComplexValue extends PointerBase { @CField("re") double realPart(); @CField("re") void realPart(double re); @CField("im") double imaginaryPart(); @CField("im") void imaginaryPart(double im); } ``` The annotated interface, or an outer class that contains the interface, must be annotated with [`CContext`](org/graalvm/nativeimage/c/CContext.md). Allocate an instances of the `struct` either by [`org.graalvm.nativeimage.StackValue.get(java.lang.Class)`](org/graalvm/nativeimage/StackValue.md#get%28java.lang.Class%29) or by [`org.graalvm.nativeimage.UnmanagedMemory.malloc(org.graalvm.word.UnsignedWord)`](org/graalvm/nativeimage/UnmanagedMemory.md#malloc%28org.graalvm.word.UnsignedWord%29). To access an array of structs one can define a special `addressOf` method: ```java @CStruct("int_double") interface IntOrDouble extends PointerBase { // allows access to individual structs in an array IntOrDouble addressOf(int index); @CField int i(); @CField void i(int i); @CField double d(); @CField void d(double d); } ``` Implementation of such method then allows one to do *array arithmetics* - e.g. obtain pointer to the first element of the array and then access the others: ```java private static double acceptIntIntDouble(IntOrDouble arr) { IntOrDouble firstInt = arr.addressOf(0); IntOrDouble secondInt = arr.addressOf(1); IntOrDouble thirdDouble = arr.addressOf(2); return firstInt.i() + secondInt.i() + thirdDouble.d(); } ``` **See also** - [`org.graalvm.nativeimage.StackValue`](org/graalvm/nativeimage/StackValue.md) - [`org.graalvm.nativeimage.UnmanagedMemory`](org/graalvm/nativeimage/UnmanagedMemory.md) ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the name of the imported C struct type. If no name is provided, the type name is used as the struct name. Default: `""`. Cite: `org/graalvm/nativeimage/c/struct/CStruct.html#value()` ### isIncomplete() `boolean isIncomplete() default false`. Since 19.0. If marked as incomplete, we will not try to determine the size of the struct. Default: `false`. Cite: `org/graalvm/nativeimage/c/struct/CStruct.html#isIncomplete()` ### addStructKeyword() `boolean addStructKeyword() default false`. Since 19.0. Add the C "struct" keyword to the name specified in `value()`. Default: `false`. Cite: `org/graalvm/nativeimage/c/struct/CStruct.html#addStructKeyword()` # @ CTypedefOfInfo [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(SOURCE) @Target({TYPE}) public @interface CTypedefOfInfo ``` Informational only. Used to document the base type of a type mentioned in a C interface annotation. Currently use with [`CPointerTo`](org/graalvm/nativeimage/c/struct/CPointerTo.md) to inform about the base primitive type of the type pointed to. ## Elements ### value() `String value() default ""`. Since 19.0. Specifies the base type the C type of this annotated C interface class is a typedef of. (i.e., typedef a1 a0; typedef a2 a1; =\> base type of a2 is a0). Default: `""`. Cite: `org/graalvm/nativeimage/c/struct/CTypedefOfInfo.html#value()` # @ RawField [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface RawField ``` Denotes a method as a field access of a [`structured C memory`](org/graalvm/nativeimage/c/struct/RawStructure.md). See [`CField`](org/graalvm/nativeimage/c/struct/CField.md) for details on allowed method signatures and the handling of annotated methods. The field is guaranteed to be aligned at its natural alignment, e.g., a field of a 8-byte type has at least 8-byte alignment. The offset of the field is not specified. # @ RawFieldAddress [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.3. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface RawFieldAddress ``` Denotes a method as a field address computation of a [`RawStructure`](org/graalvm/nativeimage/c/struct/RawStructure.md). Calls to the method are replaced with address arithmetic. The possible signatures are `IntType addressOfFieldName([IntType index]);` The return type must be a primitive integer type or a [`word type`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html). The receiver is the pointer to the [`RawStructure`](org/graalvm/nativeimage/c/struct/RawStructure.md) that is accessed. The field offset, i.e., the value that is added to the receiver, is a compile time constant. # @ RawFieldOffset [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.3. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface RawFieldOffset ``` Denotes a method as a field offset access of a [`RawStructure`](org/graalvm/nativeimage/c/struct/RawStructure.md). The method must not have any parameters. The return type must be a primitive integer type or a [`word type`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html). Calls to the method are replaced with a compile time constant. If the annotation is used on a non-static method, the receiver is ignored. Java does not allow an interface method to be declared `static native`. So the annotated method must either be non-static (with the receiver being ignored), or static but non-native (with the method body being ignored). # @ RawPointerTo [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 21.2. ```java @Retention(RUNTIME) @Target({TYPE}) public @interface RawPointerTo ``` Denotes a Java interface that is a pointer to a [`RawStructure`](org/graalvm/nativeimage/c/struct/RawStructure.md). The interface must extend [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html), i.e., it is a word type. There is never a Java class that implements the interface. If the method has a non-void return type that is not the annotated interface, it is a read-method of the pointer. Calls of the method are replaced with a memory read. The possible signatures are `ValueType read([IntType index], [LocationIdentity locationIdentity]);` If the method has the return type void, it is a write-method of the pointer. Calls of the method are replaced with a memory write. The possible signatures are `void write([IntType index], ValueType value, [LocationIdentity locationIdentity]);` If the return type of the method is the annotated interface, it is an address computation for an array access. Calls of the method are replaced with address arithmetic. The possible signatures are `PointerType addressOf(IntType index);` The receiver is the pointer that is accessed, i.e., the base address of the memory access. The `ValueType` must be the Java-equivalent of the C type used in the pointer definition. The optional parameter `index` (always the first parameter when it is present) denotes an index, i.e., the receiver is treated as an array of the pointers. The type must be a primitive integer type or a [`word type`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html). Address arithmetic is used to scale the index with the size of the value type. The optional parameter `locationIdentity` specifies the [`LocationIdentity`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/LocationIdentity.html) to be used for the memory access. Two memory accesses with two different location identities are guaranteed to not alias. The parameter cannot be used together with the [`UniqueLocationIdentity`](org/graalvm/nativeimage/c/struct/UniqueLocationIdentity.md) annotation, which is another way of providing a location identity for the memory access. ## Elements ### value() `Class value() default org.graalvm.word.WordBase.class`. Since 21.2. The value type, as a reference to a Java interface that is annotated with `RawStructure` or `RawPointerTo`. Default: `org.graalvm.word.WordBase.class`. Cite: `org/graalvm/nativeimage/c/struct/RawPointerTo.html#value()` # @ RawStructure [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({TYPE}) public @interface RawStructure ``` Denotes Java interface that represents C memory, but without a [`C struct`](org/graalvm/nativeimage/c/struct/CStruct.md) definition. The interface must extend [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html), i.e., it is a word type. There is never a Java class that implements the interface. Field accesses are done via interface methods that are annotated with [`RawField`](org/graalvm/nativeimage/c/struct/RawField.md). All calls of the interface methods are replaced with the appropriate memory operations. The layout and size of the structure is inferred from the fields defined with [`RawField`](org/graalvm/nativeimage/c/struct/RawField.md). All fields are aligned according to the field size, i.e., 8-byte types are aligned at 8-byte boundaries. It is currently not possible to influence the layout of fields. However, it is possible to reserve extra space at the end of the structure by specifying a [`RawStructure.sizeProvider`](org/graalvm/nativeimage/c/struct/RawStructure.md#sizeProvider%28%29). To access an array of structs one can define a special `addressOf` method (see [`CStruct`](org/graalvm/nativeimage/c/struct/CStruct.md) for more details). ## Elements ### sizeProvider() `Class sizeProvider() default java.util.function.IntUnaryOperator.class`. Since 19.2. Class of a function that computes the size of the structure. The input argument of the function is the size computed based on the layout of the `fields` of the structure. The returned value must not be smaller than that provided argument. By default, the size computed based on the layout is used. The provided class must have a no-argument constructor. Default: `java.util.function.IntUnaryOperator.class`. Cite: `org/graalvm/nativeimage/c/struct/RawStructure.html#sizeProvider()` # ◆ SizeOf [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java public final class SizeOf ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `SizeOf` Contains static methods that provide access to the size of **dereferenced** SystemJava pointer types (i.e. the size of the data structure pointed-to by SystemJava pointer). Note that this semantic differs from the sizeof-operator defined by the C programming language. ## Methods ### get(Class) `public static int get(Class clazz)`. Since 19.0. Returns the size of the data structure pointed to by SystemJava pointer types. The class must be annotated with `CStruct`, `CPointerTo`, or `RawStructure`. Cite: `org/graalvm/nativeimage/c/struct/SizeOf.html#get(java.lang.Class)` ### unsigned(Class) `public static UnsignedWord unsigned(Class clazz)`. Since 19.0. Returns the `size` cast to [`UnsignedWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/UnsignedWord.html). Cite: `org/graalvm/nativeimage/c/struct/SizeOf.html#unsigned(java.lang.Class)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # @ UniqueLocationIdentity [nativeimage](index.md) › [org.graalvm.nativeimage.c.struct](org/graalvm/nativeimage/c/struct/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.struct`](org/graalvm/nativeimage/c/struct/index.md). Since 19.0. ```java @Retention(RUNTIME) @Target({METHOD}) public @interface UniqueLocationIdentity ``` A [`CField`](org/graalvm/nativeimage/c/struct/CField.md) also annotated with this annotation gets a unique [`LocationIdentity`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/LocationIdentity.html) assigned, i.e., reads and writes do not interfere with reads and writes to any other field and are optimized without regarding other fields. The user has to ensure that the field is not accessed using any other location identity, e.g., it is not valid to access a field using methods in [`Pointer`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/Pointer.html). It is not possible to influence which [`LocationIdentity`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/LocationIdentity.html) is used, or to query the [`LocationIdentity`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/LocationIdentity.html). If you need a field access with a particular [`LocationIdentity`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/LocationIdentity.html), do not use this annotation. Instead, add a [`LocationIdentity`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/LocationIdentity.html) as the last parameter to the accessor methods. # ▣ org.graalvm.nativeimage.c.type [nativeimage](index.md) · Every page: [llms.txt](llms.txt) Package in nativeimage. Since 19.0. This package provides parts of the Java / C interface that are related to standard C pointer types, as well as utility functions to convert between Java types and C types. ## Interfaces - [`CCharPointer`](org/graalvm/nativeimage/c/type/CCharPointer.md): A pointer to a 8-bit C primitive value. - [`CCharPointerPointer`](org/graalvm/nativeimage/c/type/CCharPointerPointer.md): A pointer to a pointer to a 8-bit C primitive value. - [`CDoublePointer`](org/graalvm/nativeimage/c/type/CDoublePointer.md): A pointer to a C primitive 'double' value. - [`CFloatPointer`](org/graalvm/nativeimage/c/type/CFloatPointer.md): A pointer to a C primitive 'float' value. - [`CIntPointer`](org/graalvm/nativeimage/c/type/CIntPointer.md): A pointer to a 32-bit C primitive value. - [`CIntPointerPointer`](org/graalvm/nativeimage/c/type/CIntPointerPointer.md): A pointer to a pointer to a 32-bit C primitive value. - [`CLongPointer`](org/graalvm/nativeimage/c/type/CLongPointer.md): A pointer to a 64-bit C primitive value. - [`CShortPointer`](org/graalvm/nativeimage/c/type/CShortPointer.md): A pointer to a 16-bit C primitive value. - [`VoidPointer`](org/graalvm/nativeimage/c/type/VoidPointer.md): A void\* pointer to an opaque C value of an unknown type, without any methods to read or write. - [`WordPointer`](org/graalvm/nativeimage/c/type/WordPointer.md): A untyped C pointer to any machine-word-sized value, e.g., a pointer to another pointer or a pointer to a UnsignedWord or SignedWord value. ## Classes - [`CTypeConversion`](org/graalvm/nativeimage/c/type/CTypeConversion.md): Utility methods to convert between Java types and C types. ## Annotations - [`CConst`](org/graalvm/nativeimage/c/type/CConst.md): Qualifies a C type as const in an entry-point method signature. - [`CTypedef`](org/graalvm/nativeimage/c/type/CTypedef.md): Defines a name for C type to be used in an entry-point method signature. - [`CUnsigned`](org/graalvm/nativeimage/c/type/CUnsigned.md): Qualifies a C integer type as unsigned in an entry-point method signature. # ◇ CCharPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface CCharPointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A pointer to a 8-bit C primitive value. ## Methods ### read() `byte read()`. Since 19.0. Reads the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CCharPointer.html#read()` ### read(int) `byte read(int index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointer.html#read(int)` ### read(SignedWord) `byte read(SignedWord index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointer.html#read(org.graalvm.word.SignedWord)` ### write(byte) `void write(byte value)`. Since 19.0. Writes the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CCharPointer.html#write(byte)` ### write(int, byte) `void write(int index, byte value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointer.html#write(int,byte)` ### write(SignedWord, byte) `void write(SignedWord index, byte value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointer.html#write(org.graalvm.word.SignedWord,byte)` ### addressOf(int) `CCharPointer addressOf(int index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointer.html#addressOf(int)` ### addressOf(SignedWord) `CCharPointer addressOf(SignedWord index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointer.html#addressOf(org.graalvm.word.SignedWord)` ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◇ CCharPointerPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface CCharPointerPointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A pointer to a pointer to a 8-bit C primitive value. ## Methods ### read() `CCharPointer read()`. Since 19.0. Reads the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CCharPointerPointer.html#read()` ### read(int) `CCharPointer read(int index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointerPointer.html#read(int)` ### read(SignedWord) `CCharPointer read(SignedWord index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointerPointer.html#read(org.graalvm.word.SignedWord)` ### write(CCharPointer) `void write(CCharPointer value)`. Since 19.0. Writes the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CCharPointerPointer.html#write(org.graalvm.nativeimage.c.type.CCharPointer)` ### write(int, CCharPointer) `void write(int index, CCharPointer value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointerPointer.html#write(int,org.graalvm.nativeimage.c.type.CCharPointer)` ### write(SignedWord, CCharPointer) `void write(SignedWord index, CCharPointer value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointerPointer.html#write(org.graalvm.word.SignedWord,org.graalvm.nativeimage.c.type.CCharPointer)` ### addressOf(int) `CCharPointerPointer addressOf(int index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointerPointer.html#addressOf(int)` ### addressOf(SignedWord) `CCharPointerPointer addressOf(SignedWord index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CCharPointerPointer.html#addressOf(org.graalvm.word.SignedWord)` ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # @ CConst [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 23.0. ```java @Retention(RUNTIME) @Target({TYPE_USE}) public @interface CConst ``` Qualifies a C type as const in an entry-point method signature. Can be placed only on [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) types in function arguments as it applies only to the function declaration where const primitive types have no effect. # ◇ CDoublePointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface CDoublePointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A pointer to a C primitive 'double' value. ## Methods ### read() `double read()`. Since 19.0. Reads the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CDoublePointer.html#read()` ### read(int) `double read(int index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CDoublePointer.html#read(int)` ### read(SignedWord) `double read(SignedWord index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CDoublePointer.html#read(org.graalvm.word.SignedWord)` ### write(double) `void write(double value)`. Since 19.0. Writes the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CDoublePointer.html#write(double)` ### write(int, double) `void write(int index, double value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CDoublePointer.html#write(int,double)` ### write(SignedWord, double) `void write(SignedWord index, double value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CDoublePointer.html#write(org.graalvm.word.SignedWord,double)` ### addressOf(int) `CDoublePointer addressOf(int index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CDoublePointer.html#addressOf(int)` ### addressOf(SignedWord) `CDoublePointer addressOf(SignedWord index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CDoublePointer.html#addressOf(org.graalvm.word.SignedWord)` ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◇ CFloatPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface CFloatPointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A pointer to a C primitive 'float' value. ## Methods ### read() `float read()`. Since 19.0. Reads the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CFloatPointer.html#read()` ### read(int) `float read(int index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CFloatPointer.html#read(int)` ### read(SignedWord) `float read(SignedWord index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CFloatPointer.html#read(org.graalvm.word.SignedWord)` ### write(float) `void write(float value)`. Since 19.0. Writes the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CFloatPointer.html#write(float)` ### write(int, float) `void write(int index, float value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CFloatPointer.html#write(int,float)` ### write(SignedWord, float) `void write(SignedWord index, float value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CFloatPointer.html#write(org.graalvm.word.SignedWord,float)` ### addressOf(int) `CFloatPointer addressOf(int index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CFloatPointer.html#addressOf(int)` ### addressOf(SignedWord) `CFloatPointer addressOf(SignedWord index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CFloatPointer.html#addressOf(org.graalvm.word.SignedWord)` ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◇ CIntPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface CIntPointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A pointer to a 32-bit C primitive value. ## Methods ### read() `int read()`. Since 19.0. Reads the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CIntPointer.html#read()` ### read(int) `int read(int index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointer.html#read(int)` ### read(SignedWord) `int read(SignedWord index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointer.html#read(org.graalvm.word.SignedWord)` ### write(int) `void write(int value)`. Since 19.0. Writes the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CIntPointer.html#write(int)` ### write(int, int) `void write(int index, int value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointer.html#write(int,int)` ### write(SignedWord, int) `void write(SignedWord index, int value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointer.html#write(org.graalvm.word.SignedWord,int)` ### addressOf(int) `CIntPointer addressOf(int index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointer.html#addressOf(int)` ### addressOf(SignedWord) `CIntPointer addressOf(SignedWord index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointer.html#addressOf(org.graalvm.word.SignedWord)` ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◇ CIntPointerPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface CIntPointerPointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A pointer to a pointer to a 32-bit C primitive value. ## Methods ### read() `CIntPointer read()`. Since 19.0. Reads the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CIntPointerPointer.html#read()` ### read(int) `CIntPointer read(int index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointerPointer.html#read(int)` ### read(SignedWord) `CIntPointer read(SignedWord index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointerPointer.html#read(org.graalvm.word.SignedWord)` ### write(CIntPointer) `void write(CIntPointer value)`. Since 19.0. Writes the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CIntPointerPointer.html#write(org.graalvm.nativeimage.c.type.CIntPointer)` ### write(int, CIntPointer) `void write(int index, CIntPointer value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointerPointer.html#write(int,org.graalvm.nativeimage.c.type.CIntPointer)` ### write(SignedWord, CIntPointer) `void write(SignedWord index, CIntPointer value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointerPointer.html#write(org.graalvm.word.SignedWord,org.graalvm.nativeimage.c.type.CIntPointer)` ### addressOf(int) `CIntPointerPointer addressOf(int index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointerPointer.html#addressOf(int)` ### addressOf(SignedWord) `CIntPointerPointer addressOf(SignedWord index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CIntPointerPointer.html#addressOf(org.graalvm.word.SignedWord)` ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◇ CLongPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface CLongPointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A pointer to a 64-bit C primitive value. ## Methods ### read() `long read()`. Since 19.0. Reads the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CLongPointer.html#read()` ### read(int) `long read(int index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CLongPointer.html#read(int)` ### read(SignedWord) `long read(SignedWord index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CLongPointer.html#read(org.graalvm.word.SignedWord)` ### write(long) `void write(long value)`. Since 19.0. Writes the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CLongPointer.html#write(long)` ### write(int, long) `void write(int index, long value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CLongPointer.html#write(int,long)` ### write(SignedWord, long) `void write(SignedWord index, long value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CLongPointer.html#write(org.graalvm.word.SignedWord,long)` ### addressOf(int) `CLongPointer addressOf(int index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CLongPointer.html#addressOf(int)` ### addressOf(SignedWord) `CLongPointer addressOf(SignedWord index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CLongPointer.html#addressOf(org.graalvm.word.SignedWord)` ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◇ CShortPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface CShortPointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A pointer to a 16-bit C primitive value. ## Methods ### read() `short read()`. Since 19.0. Reads the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CShortPointer.html#read()` ### read(int) `short read(int index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CShortPointer.html#read(int)` ### read(SignedWord) `short read(SignedWord index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CShortPointer.html#read(org.graalvm.word.SignedWord)` ### write(short) `void write(short value)`. Since 19.0. Writes the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/CShortPointer.html#write(short)` ### write(int, short) `void write(int index, short value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CShortPointer.html#write(int,short)` ### write(SignedWord, short) `void write(SignedWord index, short value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CShortPointer.html#write(org.graalvm.word.SignedWord,short)` ### addressOf(int) `CShortPointer addressOf(int index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CShortPointer.html#addressOf(int)` ### addressOf(SignedWord) `CShortPointer addressOf(SignedWord index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/CShortPointer.html#addressOf(org.graalvm.word.SignedWord)` ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◆ CTypeConversion [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public final class CTypeConversion ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `CTypeConversion` Utility methods to convert between Java types and C types. ## Nested types - [`CTypeConversion.CCharPointerHolder`](org/graalvm/nativeimage/c/type/CTypeConversion.CCharPointerHolder.md) (interface): An auto-closable that holds a Java CharSequence as a null-terminated C char\[\] array. - [`CTypeConversion.CCharPointerPointerHolder`](org/graalvm/nativeimage/c/type/CTypeConversion.CCharPointerPointerHolder.md) (abstract class): An auto-closable that holds a Java CharSequence\[\] array as a null-terminated array of null-terminated C char\[\]s. ## Methods ### toCString(CharSequence) `public static CTypeConversion.CCharPointerHolder toCString(CharSequence javaString)`. Since 19.0. Provides access to a C pointer for the provided Java String, encoded with the default charset. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toCString(java.lang.CharSequence)` ### toCString(CharSequence, CCharPointer, UnsignedWord) `public static UnsignedWord toCString(CharSequence javaString, CCharPointer buffer, UnsignedWord bufferSize)`. Since 19.0. Copies the `javaString` into the buffer as a 0 terminated C string encoded with the default character set. When a nullptr is passed as the buffer and the buffer size is zero, then no copying is performed but the byte-sized length of the `javaString` is still returned. In case the string is larger than the `buffer`, then an `IllegalArgumentException` is thrown. Parameters: `javaString` `CharSequence`: managed Java string. `buffer` `CCharPointer`: to store the bytes of 0 terminated javaString encoded with the default charset or a nullptr. `bufferSize` `UnsignedWord`: size of the buffer or 0 when the buffer is a nullptr. Returns `UnsignedWord`: the byte-sized length of the `javaString` when represented as a C string encoded with the default character set. This length does not include the 0 terminator. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toCString(java.lang.CharSequence,org.graalvm.nativeimage.c.type.CCharPointer,org.graalvm.word.UnsignedWord)` ### toCString(CharSequence, Charset, …) `public static UnsignedWord toCString(CharSequence javaString, Charset charset, CCharPointer buffer, UnsignedWord bufferSize)`. Since 19.0. Copies the `javaString` into the buffer as a 0 terminated C string encoded with the `charset` character set. When a nullptr is passed as the buffer and the buffer size is zero, then no copying is performed but the byte-sized length of the `javaString` is still returned. In case the string is larger than the `buffer`, then an `IllegalArgumentException` is thrown. Parameters: `javaString` `CharSequence`: managed Java string. `charset` `Charset`: desired character set for the returned string. `buffer` `CCharPointer`: to store the bytes of 0 terminated javaString encoded with charset or a nullptr. `bufferSize` `UnsignedWord`: size of the buffer or 0 when the buffer is a nullptr. Returns `UnsignedWord`: the byte-sized length of the `javaString` when represented as C string encoded with the `charset` character set. This length does not include the 0 terminator. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toCString(java.lang.CharSequence,java.nio.charset.Charset,org.graalvm.nativeimage.c.type.CCharPointer,org.graalvm.word.UnsignedWord)` ### toJavaString(CCharPointer) `public static String toJavaString(CCharPointer cString)`. Since 19.0. Decodes a 0 terminated C `char*` to a Java string using the platform's default charset. Parameters: `cString` `CCharPointer`: the pointer to a 0 terminated C string. Returns `String`: a Java string. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toJavaString(org.graalvm.nativeimage.c.type.CCharPointer)` ### toJavaString(CCharPointer, UnsignedWord) `public static String toJavaString(CCharPointer cString, UnsignedWord length)`. Since 19.0. Decodes a C `char*` of length `length` to a Java string using the platform's default charset. Parameters: `cString` `CCharPointer`: the pointer to a 0 terminated C string. Returns `String`: a Java string. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toJavaString(org.graalvm.nativeimage.c.type.CCharPointer,org.graalvm.word.UnsignedWord)` ### toJavaString(CCharPointer, UnsignedWord, Charset) `public static String toJavaString(CCharPointer cString, UnsignedWord length, Charset charset)`. Since 19.0. Decodes a C `char*` of length `length` to a Java string using `charset`. Parameters: `cString` `CCharPointer`: the pointer to a 0 terminated C string. Returns `String`: a Java string. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toJavaString(org.graalvm.nativeimage.c.type.CCharPointer,org.graalvm.word.UnsignedWord,java.nio.charset.Charset)` ### utf8ToJavaString(CCharPointer) `public static String utf8ToJavaString(CCharPointer utf8String)`. Since 22.3. Decodes a UTF-8 encoded, 0 terminated C `char*` to a Java string. Parameters: `utf8String` `CCharPointer`: the pointer to a UTF-8 encoded, 0 terminated C string. Returns `String`: a Java string. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#utf8ToJavaString(org.graalvm.nativeimage.c.type.CCharPointer)` ### toCBoolean(boolean) `public static byte toCBoolean(boolean value)`. Since 19.0. Converts a Java boolean into a C int containing boolean values. Parameters: `value` `boolean`: the Java boolean value. Returns `byte`: the C boolean value. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toCBoolean(boolean)` ### toBoolean(int) `public static boolean toBoolean(int value)`. Since 19.0. Converts a C int containing boolean values into a Java boolean. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toBoolean(int)` ### toBoolean(PointerBase) `public static boolean toBoolean(PointerBase pointer)`. Since 19.0. Converts a C pointer into a Java boolean. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toBoolean(org.graalvm.word.PointerBase)` ### toCStrings(CharSequence[]) `public static CTypeConversion.CCharPointerPointerHolder toCStrings(CharSequence[] javaStrings)`. Since 19.0. Provides access to C pointers for the provided Java Strings, encoded with the default charset. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toCStrings(java.lang.CharSequence[])` ### asByteBuffer(PointerBase, int) `public static ByteBuffer asByteBuffer(PointerBase address, int size)`. Since 19.0. Creates a [`ByteBuffer`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/nio/ByteBuffer.html) that refers to the native memory at the specified address. The passed size becomes the [capacity](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/nio/Buffer.html#capacity) of the byte buffer, and the buffer's [byte order](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/nio/ByteBuffer.html#order%28%29) is set to [native byte order](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/nio/ByteOrder.html#nativeOrder%28%29). The caller is responsible for ensuring that the memory can be safely accessed while the ByteBuffer is used, and for freeing the memory afterwards. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#asByteBuffer(org.graalvm.word.PointerBase,int)` ### toCBytes(byte[]) `public static CTypeConversion.CCharPointerHolder toCBytes(byte[] bytes)`. Since 22.2. Provides access to a C pointer for the provided Java byte array. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.html#toCBytes(byte[])` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◇ CTypeConversion.CCharPointerHolder [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. Nested in [`CTypeConversion`](org/graalvm/nativeimage/c/type/CTypeConversion.md). ```java public interface CTypeConversion.CCharPointerHolder extends AutoCloseable ``` Extends: [`AutoCloseable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/AutoCloseable.html) An auto-closable that holds a Java [`CharSequence`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/CharSequence.html) as a null-terminated C char\[\] array. The C pointer is only valid as long as the auto-closeable has not been closed. ## Methods ### get() `CCharPointer get()`. Since 19.0. Returns the C pointer to the null-terminated C char[] array. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.CCharPointerHolder.html#get()` ### close() `void close()`. Since 19.0. Discards the C pointer. Overrides `close()`. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.CCharPointerHolder.html#close()` # ◆ CTypeConversion.CCharPointerPointerHolder [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Abstract class in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. Nested in [`CTypeConversion`](org/graalvm/nativeimage/c/type/CTypeConversion.md). ```java public abstract static class CTypeConversion.CCharPointerPointerHolder implements AutoCloseable ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `CCharPointerPointerHolder` Implements: [`AutoCloseable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/AutoCloseable.html) An auto-closable that holds a Java [`CharSequence`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/CharSequence.html)\[\] array as a null-terminated array of null-terminated C char\[\]s. The C pointers are only valid as long as the auto-closeable has not been closed. ## Constructors ### CCharPointerPointerHolder() `public CCharPointerPointerHolder()`. Since 19.0. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.CCharPointerPointerHolder.html#()` ## Methods ### get() `public abstract CCharPointerPointer get()`. Since 19.0. Returns the C pointer to pointers of null-terminated C char[] arrays. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.CCharPointerPointerHolder.html#get()` ### close() `public abstract void close()`. Since 19.0. Discards the C pointer. Overrides `close()`. Cite: `org/graalvm/nativeimage/c/type/CTypeConversion.CCharPointerPointerHolder.html#close()` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # @ CTypedef [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 23.0. ```java @Retention(RUNTIME) @Target({TYPE_USE}) public @interface CTypedef ``` Defines a name for C type to be used in an entry-point method signature. Can be placed either on a type declaration or at a type-use site. If placed on both, the type-use site takes precedence. ## Elements ### name() `String name()`. Since 23.0. Name to be used for this C type. Cite: `org/graalvm/nativeimage/c/type/CTypedef.html#name()` # @ CUnsigned [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Annotation interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 23.0. ```java @Retention(RUNTIME) @Target({TYPE_USE}) public @interface CUnsigned ``` Qualifies a C integer type as unsigned in an entry-point method signature. Can be placed only on integer types. # ◇ VoidPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface VoidPointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A `void*` pointer to an opaque C value of an unknown type, without any methods to read or write. ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ◇ WordPointer [nativeimage](index.md) › [org.graalvm.nativeimage.c.type](org/graalvm/nativeimage/c/type/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.c.type`](org/graalvm/nativeimage/c/type/index.md). Since 19.0. ```java public interface WordPointer extends PointerBase ``` Extends: [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html) A untyped C pointer to any machine-word-sized value, e.g., a pointer to another pointer or a pointer to a [`UnsignedWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/UnsignedWord.html) or [`SignedWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/SignedWord.html) value. ## Methods ### read() ` T read()`. Since 19.0. Reads the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/WordPointer.html#read()` ### read(int) ` T read(int index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/WordPointer.html#read(int)` ### read(SignedWord) ` T read(SignedWord index)`. Since 19.0. Reads the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/WordPointer.html#read(org.graalvm.word.SignedWord)` ### write(WordBase) `void write(WordBase value)`. Since 19.0. Writes the value at the pointer address. Cite: `org/graalvm/nativeimage/c/type/WordPointer.html#write(org.graalvm.word.WordBase)` ### write(int, WordBase) `void write(int index, WordBase value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/WordPointer.html#write(int,org.graalvm.word.WordBase)` ### write(SignedWord, WordBase) `void write(SignedWord index, WordBase value)`. Since 19.0. Writes the value of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/WordPointer.html#write(org.graalvm.word.SignedWord,org.graalvm.word.WordBase)` ### addressOf(int) `WordPointer addressOf(int index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/WordPointer.html#addressOf(int)` ### addressOf(SignedWord) `WordPointer addressOf(SignedWord index)`. Since 19.0. Computes the address of the array element with the specified index, treating the pointer as an array of the C type. Cite: `org/graalvm/nativeimage/c/type/WordPointer.html#addressOf(org.graalvm.word.SignedWord)` ## Inherited members - From interface [`PointerBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html): [`isNonNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNonNull%28%29), [`isNull`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/PointerBase.html#isNull%28%29) - From interface [`ComparableWord`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html): [`equal`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#equal%28org.graalvm.word.ComparableWord%29), [`notEqual`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/ComparableWord.html#notEqual%28org.graalvm.word.ComparableWord%29) - From interface [`WordBase`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html): [`equals`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#equals%28java.lang.Object%29), [`rawValue`](https://graalvm.elide.help/25.6.0-elide.4/api/word/org/graalvm/word/WordBase.html#rawValue%28%29) # ▣ org.graalvm.nativeimage.dynamicaccess [nativeimage](index.md) · Every page: [llms.txt](llms.txt) Package in nativeimage. Since 25.0.1. APIs for registering metadata for dynamic access at run time in Native Image: - [`org.graalvm.nativeimage.dynamicaccess.ReflectiveAccess`](org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.md) for reflection and serialization. - [`org.graalvm.nativeimage.dynamicaccess.ResourceAccess`](org/graalvm/nativeimage/dynamicaccess/ResourceAccess.md) for resources. - [`org.graalvm.nativeimage.dynamicaccess.JNIAccess`](org/graalvm/nativeimage/dynamicaccess/JNIAccess.md) for Java Native Interface (JNI) access. - [`org.graalvm.nativeimage.dynamicaccess.ForeignAccess`](org/graalvm/nativeimage/dynamicaccess/ForeignAccess.md) for foreign function access. Obtain these APIs through [`org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess`](org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.md) during [`org.graalvm.nativeimage.hosted.Feature.afterRegistration`](org/graalvm/nativeimage/hosted/Feature.md#afterRegistration%28org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess%29). Use [`org.graalvm.nativeimage.dynamicaccess.AccessCondition`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md) to make registrations conditional on a type being reached at run time. ## Interfaces - [`AccessCondition`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md): A condition that must be satisfied to register elements for dynamic access (i.e., reflection, serialization, JNI access, resource access, and foreign access at run time). - [`ForeignAccess`](org/graalvm/nativeimage/dynamicaccess/ForeignAccess.md): This interface is used to register classes, methods, and fields for foreign access at run time. - [`JNIAccess`](org/graalvm/nativeimage/dynamicaccess/JNIAccess.md): This interface is used to register classes, methods, and fields for JNI access at runtime. - [`ReflectiveAccess`](org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.md): This interface is used to register classes, methods, and fields for use with the java.lang.reflect API at run time, and for serialization at run time. - [`ResourceAccess`](org/graalvm/nativeimage/dynamicaccess/ResourceAccess.md): This interface is used to register Java resources and java.util.ResourceBundles that should be accessible at run time. # ◇ AccessCondition [nativeimage](index.md) › [org.graalvm.nativeimage.dynamicaccess](org/graalvm/nativeimage/dynamicaccess/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.dynamicaccess`](org/graalvm/nativeimage/dynamicaccess/index.md). Since 25.0.1. ```java public interface AccessCondition ``` A condition that must be satisfied to register elements for dynamic access (i.e., reflection, serialization, JNI access, resource access, and foreign access at run time). [`AccessCondition`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md) is used for programmatic metadata registration in conjunction with: - [`ReflectiveAccess`](org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.md) - [`ResourceAccess`](org/graalvm/nativeimage/dynamicaccess/ResourceAccess.md) - [`JNIAccess`](org/graalvm/nativeimage/dynamicaccess/JNIAccess.md) - [`ForeignAccess`](org/graalvm/nativeimage/dynamicaccess/ForeignAccess.md) Conditions should be used whenever possible to constrain unnecessary growth of the binary size. There are currently two types of conditions: - [`typeReached`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md#typeReached%28java.lang.Class%29) - satisfied when the type is both reachable by static analysis at build time, and reached at run time. - [`unconditional`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md#unconditional%28%29) - a condition that is always satisfied. This condition should be avoided to prevent unnecessary increases in binary size. Conditions can only be created via the [`unconditional`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md#unconditional%28%29) and [`typeReached`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md#typeReached%28java.lang.Class%29) factory methods. These methods are best used with static import methods. For example: ```java reflection.register(unconditional(), ReflectivelyAccessed.class); reflection.register(typeReached(ConditionalType.class), ConditionallyAccessed.class) ``` ## Methods ### unconditional() `static AccessCondition unconditional()`. Since 25.0.1. Returns a condition that is always satisfied. Any element that is predicated with this condition will always be included and accessible. Returns `AccessCondition`: instance of the condition. Cite: `org/graalvm/nativeimage/dynamicaccess/AccessCondition.html#unconditional()` ### typeReached(Class) `static AccessCondition typeReached(Class type)`. Since 25.0.1. Creates the `typeReached` condition that is satisfied when the type is reached at run time. A type is reached at run time, if the class-initialization is triggered for that type (right before the first step of initialization described in [Java Spec - Initialization](https://docs.oracle.com/javase/specs/jvms/se14/html/jvms-5.html#jvms-5.5)), or any of the type's subtypes are reached. Elements predicated with this condition will be included in the image only if the type is *reachable* at build time, but will be accessible when the type is *reached* at run time. **Example:** A type is also considered as reached, if it is marked as `--initialize-at-build-time` or if any of its subtypes on the classpath are marked as `--initialize-at-build-time`. Array types (e.g., `int[]`) are never marked as reached and therefore cannot be used as the `type` in a condition. Parameters: `type` `Class`: the type that has to be reached for this condition to be satisfied, must not be `null`. Returns `AccessCondition`: instance of the condition. Cite: `org/graalvm/nativeimage/dynamicaccess/AccessCondition.html#typeReached(java.lang.Class)` ```java public class App { public static void main(String[] args) { // ConditionalType not reached => element access not allowed Class clazz = ConditionalType.class; // ConditionalType not reached (ConditionalType.class doesn't start class initialization) // => element access not allowed ConditionalType.singleton(); // ConditionalType reached (already initialized) => element access allowed } } class SuperType { static { // ConditionalType reached (subtype reached) => element access allowed } } class ConditionalType extends SuperType { static { // ConditionalType reached (before static initializer) => element access allowed } static ConditionalType singleton() { // ConditionalType reached (already initialized) => element access allowed } } ``` # ◇ ForeignAccess [nativeimage](index.md) › [org.graalvm.nativeimage.dynamicaccess](org/graalvm/nativeimage/dynamicaccess/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.dynamicaccess`](org/graalvm/nativeimage/dynamicaccess/index.md). Since 25.0.1. ```java public interface ForeignAccess ``` This interface is used to register classes, methods, and fields for foreign access at run time. An instance of this interface is acquired via [`Feature.AfterRegistrationAccess.getForeignAccess()`](org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.md#getForeignAccess%28%29). All methods in [`ForeignAccess`](org/graalvm/nativeimage/dynamicaccess/ForeignAccess.md) require a [`AccessCondition`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md) as their first parameter. Registration for foreign access will happen only if the specified condition is satisfied. ### How to use [`ForeignAccess`](org/graalvm/nativeimage/dynamicaccess/ForeignAccess.md) should only be used during [`Feature.afterRegistration`](org/graalvm/nativeimage/hosted/Feature.md#afterRegistration%28org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess%29). Any attempt to register metadata in any other phase will result in an error. **Example:** ```java @Override public void afterRegistration(AfterRegistrationAccess access) { ForeignAccess foreignAccess = access.getForeignAccess(); AccessCondition condition = AccessCondition.typeReached(ConditionType.class); foreignAccess.registerForDowncall(condition, java.lang.foreign.ValueLayout.JAVA_INT); } ``` ## Methods ### registerForDowncall(AccessCondition, Object, Object...) `void registerForDowncall(AccessCondition condition, Object desc, Object... options)`. Since 25.0.1. Registers the provided function descriptor and options pair at image build time for downcalls into foreign code, if the `condition` is satisfied. Required to get a downcall method handle using [`java.lang.foreign.Linker.downcallHandle`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.html#downcallHandle%28java.lang.foreign.MemorySegment,java.lang.foreign.FunctionDescriptor,java.lang.foreign.Linker.Option...%29) for the same descriptor and options at run time. Even though this method is weakly typed for compatibility reasons, run-time checks will be performed to ensure that the arguments have the expected type. It will be deprecated in favor of strongly typed variant as soon as possible. Parameters: `condition` `AccessCondition`: represents the condition that needs to be satisfied in order to access target resources. `desc` `Object`: A [`java.lang.foreign.FunctionDescriptor`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/FunctionDescriptor.html) to register for downcalls. `options` `Object...`: An array of [`java.lang.foreign.Linker.Option`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.Option.html) used for the downcalls. Cite: `org/graalvm/nativeimage/dynamicaccess/ForeignAccess.html#registerForDowncall(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.Object,java.lang.Object...)` ### registerForUpcall(AccessCondition, Object, Object...) `void registerForUpcall(AccessCondition condition, Object desc, Object... options)`. Since 25.0.1. Registers the provided function descriptor and options pair at image build time for upcalls from foreign code, if the `condition` is satisfied. Required to get an upcall stub function pointer using [`java.lang.foreign.Linker.upcallStub`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.html#upcallStub%28java.lang.invoke.MethodHandle,java.lang.foreign.FunctionDescriptor,java.lang.foreign.Arena,java.lang.foreign.Linker.Option...%29) for the same descriptor and options at run time. Even though this method is weakly typed for compatibility reasons, run-time checks will be performed to ensure that the arguments have the expected type. It will be deprecated in favor of strongly typed variant as soon as possible. Parameters: `condition` `AccessCondition`: represents the condition that needs to be satisfied in order to access target resources. `desc` `Object`: A [`java.lang.foreign.FunctionDescriptor`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/FunctionDescriptor.html) to register for upcalls. `options` `Object...`: An array of [`java.lang.foreign.Linker.Option`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.Option.html) used for the upcalls. Cite: `org/graalvm/nativeimage/dynamicaccess/ForeignAccess.html#registerForUpcall(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.Object,java.lang.Object...)` ### registerForDirectUpcall(AccessCondition, MethodHandle, …) `void registerForDirectUpcall(AccessCondition condition, MethodHandle target, Object desc, Object... options)`. Since 25.0.1. Registers a specific static method (denoted by a method handle) as a fast upcall target, if the `condition` is satisfied. This will create a specialized upcall stub that will invoke only the specified method, which is much faster than using `registerForUpcall(AccessCondition, Object, Object...)`). The provided method handle must be a direct method handle. Those are most commonly created using [`java.lang.invoke.MethodHandles.Lookup.findStatic(Class, String, MethodType)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/invoke/MethodHandles.Lookup.html#findStatic%28java.lang.Class,java.lang.String,java.lang.invoke.MethodType%29). However, a strict requirement is that it must be possible to create a non-empty descriptor for the method handle using [`MethodHandle.describeConstable()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/invoke/MethodHandle.html#describeConstable%28%29). The denoted static method will also be registered for reflective access since run-time code will also create a method handle to denoted static method. Even though this method is weakly typed for compatibility reasons, run-time checks will be performed to ensure that the arguments have the expected type. It will be deprecated in favor of strongly typed variant as soon as possible. Parameters: `condition` `AccessCondition`: represents the condition that needs to be satisfied in order to access target resources. `target` `MethodHandle`: A direct method handle denoting a static method. `desc` `Object`: A [`java.lang.foreign.FunctionDescriptor`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/FunctionDescriptor.html) to register for upcalls. `options` `Object...`: An array of [`java.lang.foreign.Linker.Option`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.Option.html) used for the upcalls. Cite: `org/graalvm/nativeimage/dynamicaccess/ForeignAccess.html#registerForDirectUpcall(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.invoke.MethodHandle,java.lang.Object,java.lang.Object...)` # ◇ JNIAccess [nativeimage](index.md) › [org.graalvm.nativeimage.dynamicaccess](org/graalvm/nativeimage/dynamicaccess/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.dynamicaccess`](org/graalvm/nativeimage/dynamicaccess/index.md). Since 25.0.1. ```java public interface JNIAccess ``` This interface is used to register classes, methods, and fields for JNI access at runtime. An instance of this interface is acquired via [`Feature.AfterRegistrationAccess.getJNIAccess()`](org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.md#getJNIAccess%28%29). All methods in [`JNIAccess`](org/graalvm/nativeimage/dynamicaccess/JNIAccess.md) require a [`AccessCondition`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md) as their first parameter. A class and its members will be registered for JNI access only if the specified condition is satisfied. ### How to use [`JNIAccess`](org/graalvm/nativeimage/dynamicaccess/JNIAccess.md) should only be used during [`Feature.afterRegistration`](org/graalvm/nativeimage/hosted/Feature.md#afterRegistration%28org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess%29). Any attempt to register metadata in any other phase will result in an error. **Example:** ```java @Override public void afterRegistration(AfterRegistrationAccess access) { JNIAccess jniAccess = access.getJNIAccess(); AccessCondition condition = AccessCondition.typeReached(ConditionType.class); jniAccess.register(condition, Foo.class); jniAccess.register(condition, Foo.class.getMethod("method")); jniAccess.register(condition, Foo.class.getField("field")); } ``` **See also** - [Java docs - JNI functions](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html) ## Methods ### register(AccessCondition, Class...) `void register(AccessCondition condition, Class... classes)`. Since 25.0.1. Registers the provided classes for JNI access at run time, if the `condition` is satisfied. Cite: `org/graalvm/nativeimage/dynamicaccess/JNIAccess.html#register(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.Class...)` ### register(AccessCondition, Executable...) `void register(AccessCondition condition, Executable... methods)`. Since 25.0.1. Registers the provided methods for JNI access at run time, if the `condition` is satisfied. Cite: `org/graalvm/nativeimage/dynamicaccess/JNIAccess.html#register(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.reflect.Executable...)` ### register(AccessCondition, Field...) `void register(AccessCondition condition, Field... fields)`. Since 25.0.1. Registers the provided fields for JNI access at run time, if the `condition` is satisfied. Cite: `org/graalvm/nativeimage/dynamicaccess/JNIAccess.html#register(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.reflect.Field...)` # ◇ ReflectiveAccess [nativeimage](index.md) › [org.graalvm.nativeimage.dynamicaccess](org/graalvm/nativeimage/dynamicaccess/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.dynamicaccess`](org/graalvm/nativeimage/dynamicaccess/index.md). Since 25.0.1. ```java public interface ReflectiveAccess ``` This interface is used to register classes, methods, and fields for use with the [`java.lang.reflect`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/package-summary.html) API at run time, and for serialization at run time. An instance of this interface is acquired via [`Feature.AfterRegistrationAccess.getReflectiveAccess()`](org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.md#getReflectiveAccess%28%29). All methods in [`ReflectiveAccess`](org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.md) require a [`AccessCondition`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md) as their first parameter. A class and its members will be accessible at run-time only if the specified condition is satisfied. ### How to use [`ReflectiveAccess`](org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.md) should only be used during [`Feature.afterRegistration`](org/graalvm/nativeimage/hosted/Feature.md#afterRegistration%28org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess%29). Attempts to register metadata in any other phase of the [`Feature`](org/graalvm/nativeimage/hosted/Feature.md) API will result in an error. **Example:** ```java @Override public void afterRegistration(AfterRegistrationAccess access) { ReflectionAccess reflection = access.getReflectionAccess(); AccessCondition condition = AccessCondition.typeReached(ConditionType.class); reflection.register(condition, Foo.class, Bar.class); reflection.register(AccessCondition.unconditional(), Foo.class.getMethod("method")); reflection.registerForUnsafeAllocation(condition, Foo.class); Class proxyClass = reflection.registerProxy(condition, Interface1.class, Interface2.class); reflection.registerForSerialization(AccessCondition.unconditional(), proxyClass); } ``` ## Methods ### register(AccessCondition, Class...) `void register(AccessCondition condition, Class... classes)`. Since 25.0.1. Registers the provided classes for reflection at run time, if the `condition` is satisfied. This means all reflection methods defined by the [`java.lang.Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html) (except [`Class.arrayType()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#arrayType%28%29)) are accessible at run time for those classes. If a class is not registered for reflection at run time, the following methods will throw [`ClassNotFoundException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/ClassNotFoundException.html): [`Class.forName(String)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#forName%28java.lang.String%29); [`Class.forName(Module, String)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#forName%28java.lang.Module,java.lang.String%29); [`Class.forName(String, boolean, ClassLoader)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#forName%28java.lang.String,boolean,java.lang.ClassLoader%29); [`ClassLoader.loadClass(String)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/ClassLoader.html#loadClass%28java.lang.String%29). Cite: `org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.html#register(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.Class...)` ### register(AccessCondition, Executable...) `void register(AccessCondition condition, Executable... executables)`. Since 25.0.1. Registers the provided `executables` (methods and constructors) for reflective invocation at run time, if the `condition` is satisfied. This method also registers the declaring classes of the provided executables for reflection at run time. The executables will be invocable at run time via [`java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Method.html#invoke%28java.lang.Object,java.lang.Object...%29). Cite: `org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.html#register(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.reflect.Executable...)` ### register(AccessCondition, Field...) `void register(AccessCondition condition, Field... fields)`. Since 25.0.1. Registers the provided `fields` for reflective access at run time, if the `condition` is satisfied. This method also registers the declaring classes of the provided fields for reflection at run time. The fields will be accessible at run time via following methods: [`java.lang.reflect.Field.get`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#get%28java.lang.Object%29); [`java.lang.reflect.Field.set`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#set%28java.lang.Object,java.lang.Object%29); [`java.lang.reflect.Field.getByte`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#getByte%28java.lang.Object%29); [`java.lang.reflect.Field.setByte`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#setByte%28java.lang.Object,byte%29); [`java.lang.reflect.Field.getChar`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#getChar%28java.lang.Object%29); [`java.lang.reflect.Field.setChar`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#setChar%28java.lang.Object,char%29); [`java.lang.reflect.Field.getShort`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#getShort%28java.lang.Object%29); [`java.lang.reflect.Field.setShort`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#setShort%28java.lang.Object,short%29); [`java.lang.reflect.Field.getInt`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#getInt%28java.lang.Object%29); [`java.lang.reflect.Field.setInt`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#setInt%28java.lang.Object,int%29); [`java.lang.reflect.Field.getLong`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#getLong%28java.lang.Object%29); [`java.lang.reflect.Field.setLong`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#setLong%28java.lang.Object,long%29); [`java.lang.reflect.Field.getFloat`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#getFloat%28java.lang.Object%29); [`java.lang.reflect.Field.setFloat`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#setFloat%28java.lang.Object,float%29); [`java.lang.reflect.Field.getDouble`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#getDouble%28java.lang.Object%29); [`java.lang.reflect.Field.setDouble`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html#setDouble%28java.lang.Object,double%29). Cite: `org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.html#register(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.reflect.Field...)` ### registerForSerialization(AccessCondition, Class...) `void registerForSerialization(AccessCondition condition, Class... classes)`. Since 25.0.1. Registers the provided classes for serialization at run time, if the `condition` is satisfied. This method also registers the provided classes for reflection at run time. The following methods require a type to be registered for serialization: [`java.io.ObjectOutputStream.writeObject`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/io/ObjectOutputStream.html#writeObject%28java.lang.Object%29); [`java.io.ObjectOutputStream.writeUnshared`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/io/ObjectOutputStream.html#writeUnshared%28java.lang.Object%29); [`java.io.ObjectInputStream.readObject()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/io/ObjectInputStream.html#readObject%28%29); [`java.io.ObjectInputStream.readUnshared`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/io/ObjectInputStream.html#readUnshared%28%29). Cite: `org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.html#registerForSerialization(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.Class...)` ### registerProxy(AccessCondition, Class...) `Class registerProxy(AccessCondition condition, Class... interfaces)`. Since 25.0.1. Registers a [`java.lang.reflect.Proxy`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Proxy.html) class in the system classloader that implements the specified `interfaces`, if the `condition` is satisfied. The proxy class is fully specified by the interfaces it implements, and proxy instances matching that specification can be created at run time. The returned proxy class can be used in registration for serialization at run time. **NOTE**: The order of the interfaces provided in the `interfaces` parameter is significant; different orderings will produce distinct proxy classes. **Example**: Returns `Class`: Proxy class defined by the provided interfaces, or `null` if no such proxy class can be created with the given interfaces. Cite: `org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.html#registerProxy(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.Class...)` ```java Class proxyClass = reflection.registerProxy(AccessCondition.unconditional(), Interface1.class, Interface2.class); reflection.registerForSerialization(AccessCondition.unconditional(), proxyClass); ``` ### registerForUnsafeAllocation(AccessCondition, Class...) `void registerForUnsafeAllocation(AccessCondition condition, Class... classes)`. Since 25.0.1. Registers the provided `classes` for unsafe allocation at run time, if the `condition` is satisfied. Unsafe allocation can happen via `sun.misc.Unsafe.allocateInstance(Class)` or from native code via `AllocObject(jClass)`. Cite: `org/graalvm/nativeimage/dynamicaccess/ReflectiveAccess.html#registerForUnsafeAllocation(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.Class...)` # ◇ ResourceAccess [nativeimage](index.md) › [org.graalvm.nativeimage.dynamicaccess](org/graalvm/nativeimage/dynamicaccess/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.dynamicaccess`](org/graalvm/nativeimage/dynamicaccess/index.md). Since 25.0.1. ```java public interface ResourceAccess ``` This interface is used to register Java resources and [`java.util.ResourceBundle`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/ResourceBundle.html)s that should be accessible at run time. An instance of this interface is acquired via [`Feature.AfterRegistrationAccess.getResourceAccess()`](org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.md#getResourceAccess%28%29). All methods in [`ResourceAccess`](org/graalvm/nativeimage/dynamicaccess/ResourceAccess.md) require a [`AccessCondition`](org/graalvm/nativeimage/dynamicaccess/AccessCondition.md) as their first parameter. Resources will be registered for run-time access only if the specified `condition` is satisfied. ### How to use [`ResourceAccess`](org/graalvm/nativeimage/dynamicaccess/ResourceAccess.md) should only be used during [`Feature.afterRegistration`](org/graalvm/nativeimage/hosted/Feature.md#afterRegistration%28org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess%29). Attempts to register metadata in any other phase of the [`Feature`](org/graalvm/nativeimage/hosted/Feature.md) API will result in an error. **Example:** ```java @Override public void afterRegistration(AfterRegistrationAccess access) { ResourceAccess resources = access.getResourceAccess(); AccessCondition condition = AccessCondition.typeReached(ConditionType.class); resources.register(condition, "example/**"); resources.register(AccessCondition.unconditional(), "example/directory/concreteResource"); resources.register(condition, "example/concreteResourceStar\\*"); try { ResourceBundle bundle = ResourceBundle.getBundle("bundlePath1"); resources.registerResourceBundle(condition, bundle); } catch (MissingResourceException e) { // Log or handle the missing resource } } ``` ## Methods ### register(AccessCondition, Module, String) `void register(AccessCondition condition, Module module, String glob)`. Since 25.0.1. Registers resources matching the specified `glob` in the provided `module` for run-time access, if the `condition` is satisfied. The `glob` uses a subset of [glob-pattern](https://en.wikipedia.org/wiki/Glob_%28programming%29) rules for specifying resources. There are several rules to be observed when specifying a resource path: The `native-image` tool supports only `star (*)` and `globstar (**)` wildcard patterns. By definition, `star` can match any number of any characters on one level while `globstar` can match any number of characters at any level.; If there is a need to treat a star literally (without special meaning), it can be escaped using `\` (for example, `\*`).; In the glob, a **level** represents a part of the pattern separated with `/`.; When writing glob patterns the following rules must be observed: Glob cannot be empty (for example, `""`); Glob cannot end with a trailing slash ('/') (for example, `"foo/bar/"`); Glob cannot contain more than two consecutive (non-escaped) `*` characters on one level (for example, `"foo/***/"`); Glob cannot contain empty levels (for example, `"foo//bar"`); Glob cannot contain two consecutive globstar wildcards (example, `"foo/**/**"`); Glob cannot have other content on the same level as globstar wildcard (for example, `"foo/**bar/x"`) Given the following project structure: You can: Include all resources with glob `**/Resource*.txt`; Include `Resource0.txt` with glob `**/Resource0.txt`; Include `Resource0.txt` and `Resource1.txt` with globs `**/Resource0.txt` and `**/Resource1.txt`. Parameters: `condition` `AccessCondition`: the condition that must be satisfied to register the target resource. `module` `Module`: the Java module instance that contains target resources. If the provided value is `null` or an unnamed module, resources are looked up on the classpath instead. `glob` `String`: the glob that is matched against all resources. Cite: `org/graalvm/nativeimage/dynamicaccess/ResourceAccess.html#register(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.Module,java.lang.String)` ```java app/src/main/resources/{Resource0.txt, Resource1.txt} ``` ### register(AccessCondition, String) `default void register(AccessCondition condition, String glob)`. Since 25.0.1. Registers resources matching the specified `glob` from the classpath for run-time access, if the `condition` is satisfied. The `glob` uses a subset of [glob-pattern](https://en.wikipedia.org/wiki/Glob_%28programming%29) rules for specifying resources. There are several rules to be observed when specifying a resource path: The `native-image` tool supports only `star (*)` and `globstar (**)` wildcard patterns. By definition, `star` can match any number of any characters on one level while `globstar` can match any number of characters at any level.; If there is a need to treat a star literally (without special meaning), it can be escaped using `\` (for example, `\*`).; In the glob, a **level** represents a part of the pattern separated with `/`.; When writing glob patterns the following rules must be observed: Glob cannot be empty (for example, `""`); Glob cannot end with a trailing slash ('/') (for example, `"foo/bar/"`); Glob cannot contain more than two consecutive (non-escaped) `*` characters on one level (for example, `"foo/***/"`); Glob cannot contain empty levels (for example, `"foo//bar"`); Glob cannot contain two consecutive globstar wildcards (example, `"foo/**/**"`); Glob cannot have other content on the same level as globstar wildcard (for example, `"foo/**bar/x"`) Given the following project structure: You can: Include all resources with glob `**/Resource*.txt`; Include `Resource0.txt` with glob `**/Resource0.txt`; Include `Resource0.txt` and `Resource1.txt}` with globs `**/Resource0.txt` and `**/Resource1.txt`. Parameters: `condition` `AccessCondition`: the condition that must be satisfied to register the target resource. `glob` `String`: the glob that is matched against all resources. Cite: `org/graalvm/nativeimage/dynamicaccess/ResourceAccess.html#register(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.lang.String)` ```java app/src/main/resources/{Resource0.txt, Resource1.txt} ``` ### registerResourceBundle(AccessCondition, ResourceBundle...) `void registerResourceBundle(AccessCondition condition, ResourceBundle... bundles)`. Since 25.0.1. Registers the provided [`java.util.ResourceBundle`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/ResourceBundle.html)s for run-time access, if the `condition` is satisfied. Each [`java.util.ResourceBundle`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/ResourceBundle.html) must be obtained using any version of the [`java.util.ResourceBundle.getBundle`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/ResourceBundle.html#getBundle%28java.lang.String%29) method. A bundle created in any other way will result in an error. **Recommended use to avoid crashes during image building:**. Cite: `org/graalvm/nativeimage/dynamicaccess/ResourceAccess.html#registerResourceBundle(org.graalvm.nativeimage.dynamicaccess.AccessCondition,java.util.ResourceBundle...)` ```java @Override public void afterRegistration(AfterRegistrationAccess access) { ResourceAccess resources = access.getResourceAccess(); AccessCondition condition = AccessCondition.typeReached(ConditionType.class); try { ResourceBundle bundle1 = ResourceBundle.getBundle("bundlePath1"); ResourceBundle bundle2 = ResourceBundle.getBundle("bundlePath2"); resources.registerResourceBundle(condition, bundle1, bundle2); } catch (MissingResourceException e) { // Log or handle the missing resource } } ``` # ▣ org.graalvm.nativeimage.hosted [nativeimage](index.md) · Every page: [llms.txt](llms.txt) Package in nativeimage. Since 19.0. The GraalVM SDK Native Image API allows to customize the native image generation, i.e., the ahead-of-time compilation of Java code to standalone executables: - [`org.graalvm.nativeimage.hosted.Feature`](org/graalvm/nativeimage/hosted/Feature.md)s allow clients to intercept the native image generation and run custom initialization code at various stages. - [`org.graalvm.nativeimage.hosted.RuntimeClassInitialization`](org/graalvm/nativeimage/hosted/RuntimeClassInitialization.md) is used to configure when classes are initialized. - [`org.graalvm.nativeimage.hosted.RuntimeReflection`](org/graalvm/nativeimage/hosted/RuntimeReflection.md) to register classes, methods, and fields for reflection at run time. ## Interfaces - [`Feature`](org/graalvm/nativeimage/hosted/Feature.md): Features allow clients to intercept the native image generation and run custom initialization code at various stages. - [`FieldValueTransformer`](org/graalvm/nativeimage/hosted/FieldValueTransformer.md): A transformer for a field value that can be registered using BeforeAnalysisAccess.registerFieldValueTransformer. ## Classes - [`RuntimeClassInitialization`](org/graalvm/nativeimage/hosted/RuntimeClassInitialization.md): This class provides methods that can be called during native-image building to configure class initialization behavior. - [`RuntimeForeignAccess`](org/graalvm/nativeimage/hosted/RuntimeForeignAccess.md): No description. - [`RuntimeJNIAccess`](org/graalvm/nativeimage/hosted/RuntimeJNIAccess.md): This class provides methods that can be called during native image generation to register classes, methods, and fields for JNI access at run time. - [`RuntimeProxyCreation`](org/graalvm/nativeimage/hosted/RuntimeProxyCreation.md): This class can be used to make creating dynamic proxy classes at run time valid. - [`RuntimeReflection`](org/graalvm/nativeimage/hosted/RuntimeReflection.md): This class provides methods that can be called during native image generation to register classes, methods, and fields for reflection at run time. - [`RuntimeResourceAccess`](org/graalvm/nativeimage/hosted/RuntimeResourceAccess.md): This class can be used to register Java resources and ResourceBundles that should be accessible at run time. - [`RuntimeSerialization`](org/graalvm/nativeimage/hosted/RuntimeSerialization.md): This class provides methods that can be called before and during analysis, to register classes for serialization at image runtime. - [`RuntimeSystemProperties`](org/graalvm/nativeimage/hosted/RuntimeSystemProperties.md): This class provides methods that can be called during native image generation to define system property setting for image runtime. # ◇ Feature [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. ```java public interface Feature ``` Features allow clients to intercept the native image generation and run custom initialization code at various stages. All code within feature classes is executed during native image generation, and never at run time. Features have several advantages over static class initializers (which also run during native image generation): - The different feature methods are called at different stages during native image generation, which gives clients control over when code is executed. - Feature methods have an `access` parameter that allows callbacks into the native image generator. - Feature methods run when the [`ImageSingletons`](org/graalvm/nativeimage/ImageSingletons.md) is already set up, which allows features to prepare data structures that are then used at run time by querying the [`ImageSingletons`](org/graalvm/nativeimage/ImageSingletons.md) . Implementation classes must have a no-argument constructor, which is used to instantiate a singleton instance for each feature using reflection. The following features are included during native image generation: - Features explicitly specified on the command line. - Features referenced as [`required`](org/graalvm/nativeimage/hosted/Feature.md#getRequiredFeatures%28%29) by another included feature. Required features are added transitively, and initialization methods of required features are called after invoking the constructor and [`isInConfiguration`](org/graalvm/nativeimage/hosted/Feature.md#isInConfiguration%28org.graalvm.nativeimage.hosted.Feature.IsInConfigurationAccess%29) of the requiring features (unless the feature dependencies are cyclic). ## Nested types - [`Feature.AfterAnalysisAccess`](org/graalvm/nativeimage/hosted/Feature.AfterAnalysisAccess.md) (interface): Access methods available for Feature.afterAnalysis. - [`Feature.AfterCompilationAccess`](org/graalvm/nativeimage/hosted/Feature.AfterCompilationAccess.md) (interface): Access methods available for Feature.afterCompilation. - [`Feature.AfterHeapLayoutAccess`](org/graalvm/nativeimage/hosted/Feature.AfterHeapLayoutAccess.md) (interface): Access methods available for Feature.afterHeapLayout. - [`Feature.AfterImageWriteAccess`](org/graalvm/nativeimage/hosted/Feature.AfterImageWriteAccess.md) (interface): Access methods available for Feature.afterImageWrite. - [`Feature.AfterRegistrationAccess`](org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.md) (interface): Access methods available for Feature.afterRegistration. - [`Feature.BeforeAnalysisAccess`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md) (interface): Access methods available for Feature.beforeAnalysis. - [`Feature.BeforeCompilationAccess`](org/graalvm/nativeimage/hosted/Feature.BeforeCompilationAccess.md) (interface): Access methods available for Feature.beforeCompilation. - [`Feature.BeforeHeapLayoutAccess`](org/graalvm/nativeimage/hosted/Feature.BeforeHeapLayoutAccess.md) (interface): Access methods available for Feature.beforeHeapLayout. - [`Feature.BeforeImageWriteAccess`](org/graalvm/nativeimage/hosted/Feature.BeforeImageWriteAccess.md) (interface): Access methods available for Feature.beforeImageWrite. - [`Feature.BeforeUniverseBuildingAccess`](org/graalvm/nativeimage/hosted/Feature.BeforeUniverseBuildingAccess.md) (interface): Access methods available for Feature.beforeUniverseBuilding. - [`Feature.CompilationAccess`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md) (interface): Access methods available for Feature.beforeCompilation and Feature.afterCompilation. - [`Feature.DuringAnalysisAccess`](org/graalvm/nativeimage/hosted/Feature.DuringAnalysisAccess.md) (interface): Access methods available for Feature.duringAnalysis. - [`Feature.DuringSetupAccess`](org/graalvm/nativeimage/hosted/Feature.DuringSetupAccess.md) (interface): Access methods available for Feature.duringSetup. - [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) (interface): Access methods that are available for all feature methods. - [`Feature.IsInConfigurationAccess`](org/graalvm/nativeimage/hosted/Feature.IsInConfigurationAccess.md) (interface): Access methods available for Feature.isInConfiguration. - [`Feature.OnAnalysisExitAccess`](org/graalvm/nativeimage/hosted/Feature.OnAnalysisExitAccess.md) (interface): Access methods available for Feature.onAnalysisExit. - [`Feature.OnRegistrationAccess`](org/graalvm/nativeimage/hosted/Feature.OnRegistrationAccess.md) (interface): Access methods available for Feature.onRegistration. - [`Feature.QueryReachabilityAccess`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md) (interface): Access reachability methods available for Feature.afterAnalysis and Feature.duringAnalysis. ## Methods ### getURL() `default String getURL()`. Since 22.2. A URL to documentation or the sources of the feature. The URL will be used as a link for the feature in the build output (if supported by the user's terminal). Cite: `org/graalvm/nativeimage/hosted/Feature.html#getURL()` ### getDescription() `default String getDescription()`. Since 22.2. A short description of the feature (e.g., "Enables Truffle support"). The description is displayed to users as part of the build output. Cite: `org/graalvm/nativeimage/hosted/Feature.html#getDescription()` ### isInConfiguration(Feature.IsInConfigurationAccess) `default boolean isInConfiguration(Feature.IsInConfigurationAccess access)`. Since 19.0. This method is called immediately after the constructor, to check whether the feature is part of the configuration or not. If this method returns false, the feature is not included in the list of features and no other methods are called (in particular, the `required features` are not processed). Parameters: `access` `Feature.IsInConfigurationAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#isInConfiguration(org.graalvm.nativeimage.hosted.Feature.IsInConfigurationAccess)` ### getRequiredFeatures() `default List> getRequiredFeatures()`. Since 19.0. Returns the list of features that this feature depends on. As long as the dependency chain is non-cyclic, all required features are processed before this feature for all lifecycle hooks after `onRegistration(OnRegistrationAccess)`. The `onRegistration` hook is the exception: it is called as soon as a feature is registered, before its required features are processed. Cite: `org/graalvm/nativeimage/hosted/Feature.html#getRequiredFeatures()` ### onRegistration(Feature.OnRegistrationAccess) `default void onRegistration(Feature.OnRegistrationAccess access)`. Since 25.1.3. Handler for initialization that must happen as soon as this feature is registered, before its required features are processed. Use this hook only for state that must be visible during feature registration. Prefer publishing dedicated support objects through `ImageSingletons`; publishing the feature instance itself should be reserved for compatibility with existing feature-singleton queries. Parameters: `access` `Feature.OnRegistrationAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#onRegistration(org.graalvm.nativeimage.hosted.Feature.OnRegistrationAccess)` ### afterRegistration(Feature.AfterRegistrationAccess) `default void afterRegistration(Feature.AfterRegistrationAccess access)`. Since 19.0. Handler for initializations after all features have been registered and all options have been parsed; but before any initializations for the static analysis have happened. Parameters: `access` `Feature.AfterRegistrationAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#afterRegistration(org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess)` ### duringSetup(Feature.DuringSetupAccess) `default void duringSetup(Feature.DuringSetupAccess access)`. Since 19.0. Handler for initializations at startup time. It allows customization of the static analysis setup. Parameters: `access` `Feature.DuringSetupAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#duringSetup(org.graalvm.nativeimage.hosted.Feature.DuringSetupAccess)` ### beforeAnalysis(Feature.BeforeAnalysisAccess) `default void beforeAnalysis(Feature.BeforeAnalysisAccess access)`. Since 19.0. Handler for initializations before the static analysis. Parameters: `access` `Feature.BeforeAnalysisAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#beforeAnalysis(org.graalvm.nativeimage.hosted.Feature.BeforeAnalysisAccess)` ### duringAnalysis(Feature.DuringAnalysisAccess) `default void duringAnalysis(Feature.DuringAnalysisAccess access)`. Since 19.0. Handler for performing operations during the static analysis. This handler is called after analysis is complete. So all analysis meta data is available. If the handler performs changes, e.g., makes new types or methods reachable, it needs to call `DuringAnalysisAccess.requireAnalysisIteration()`. This triggers a new iteration: analysis is performed again and the handler is called again. Parameters: `access` `Feature.DuringAnalysisAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#duringAnalysis(org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess)` ### afterAnalysis(Feature.AfterAnalysisAccess) `default void afterAnalysis(Feature.AfterAnalysisAccess access)`. Since 19.0. Handler for initializations after analysis and before universe creation. Parameters: `access` `Feature.AfterAnalysisAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#afterAnalysis(org.graalvm.nativeimage.hosted.Feature.AfterAnalysisAccess)` ### onAnalysisExit(Feature.OnAnalysisExitAccess) `default void onAnalysisExit(Feature.OnAnalysisExitAccess access)`. Since 19.0. Handler for code that needs to run after the analysis, even if an error has occurred, e.g., like reporting code. Parameters: `access` `Feature.OnAnalysisExitAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#onAnalysisExit(org.graalvm.nativeimage.hosted.Feature.OnAnalysisExitAccess)` ### beforeUniverseBuilding(Feature.BeforeUniverseBuildingAccess) `default void beforeUniverseBuilding(Feature.BeforeUniverseBuildingAccess access)`. Since 21.1. Handler for code that needs to run before universe building, but after hosted meta-access has been created. Parameters: `access` `Feature.BeforeUniverseBuildingAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#beforeUniverseBuilding(org.graalvm.nativeimage.hosted.Feature.BeforeUniverseBuildingAccess)` ### beforeCompilation(Feature.BeforeCompilationAccess) `default void beforeCompilation(Feature.BeforeCompilationAccess access)`. Since 19.0. Handler for initializations before compilation. Parameters: `access` `Feature.BeforeCompilationAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#beforeCompilation(org.graalvm.nativeimage.hosted.Feature.BeforeCompilationAccess)` ### afterCompilation(Feature.AfterCompilationAccess) `default void afterCompilation(Feature.AfterCompilationAccess access)`. Since 19.0. Handler for initializations after compilation, i.e., before the native image is written. Parameters: `access` `Feature.AfterCompilationAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#afterCompilation(org.graalvm.nativeimage.hosted.Feature.AfterCompilationAccess)` ### beforeHeapLayout(Feature.BeforeHeapLayoutAccess) `default void beforeHeapLayout(Feature.BeforeHeapLayoutAccess access)`. Since 23.2. Handler for initializations before the native image heap and code layout. Parameters: `access` `Feature.BeforeHeapLayoutAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#beforeHeapLayout(org.graalvm.nativeimage.hosted.Feature.BeforeHeapLayoutAccess)` ### afterHeapLayout(Feature.AfterHeapLayoutAccess) `default void afterHeapLayout(Feature.AfterHeapLayoutAccess access)`. Since 19.0. Handler for initializations after the native image heap and code layout. Objects and methods have their offsets assigned. At this point, no additional objects must be added to the native image heap, i.e., modifying object fields of native image objects that are part of the native image heap is not allowed at this point. Parameters: `access` `Feature.AfterHeapLayoutAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#afterHeapLayout(org.graalvm.nativeimage.hosted.Feature.AfterHeapLayoutAccess)` ### beforeImageWrite(Feature.BeforeImageWriteAccess) `default void beforeImageWrite(Feature.BeforeImageWriteAccess access)`. Since 19.0. Handler for altering the linker command after the native image has been built and before it is written. Parameters: `access` `Feature.BeforeImageWriteAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#beforeImageWrite(org.graalvm.nativeimage.hosted.Feature.BeforeImageWriteAccess)` ### afterImageWrite(Feature.AfterImageWriteAccess) `default void afterImageWrite(Feature.AfterImageWriteAccess access)`. Since 19.0. Handler for altering the image (or shared object) that the linker command produced. Parameters: `access` `Feature.AfterImageWriteAccess`: The supported operations that the feature can perform at this time. Cite: `org/graalvm/nativeimage/hosted/Feature.html#afterImageWrite(org.graalvm.nativeimage.hosted.Feature.AfterImageWriteAccess)` ### cleanup() `default void cleanup()`. Since 19.0. Handler for cleanup. Can be used to cleanup static data. This can avoid memory leaks if native image generation is done many times, e.g. during unit tests. Usually, overriding this method can be avoided by putting a configuration object into the `ImageSingletons`. Cite: `org/graalvm/nativeimage/hosted/Feature.html#cleanup()` # ◇ Feature.AfterAnalysisAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.AfterAnalysisAccess extends Feature.QueryReachabilityAccess ``` Extends: [`Feature.QueryReachabilityAccess`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md) Access methods available for [`Feature.afterAnalysis`](org/graalvm/nativeimage/hosted/Feature.md#afterAnalysis%28org.graalvm.nativeimage.hosted.Feature.AfterAnalysisAccess%29). ## Inherited members - From interface [`Feature.QueryReachabilityAccess`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md): [`isReachable`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#isReachable%28java.lang.Class%29), [`isReachable`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#isReachable%28java.lang.reflect.Executable%29), [`isReachable`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#isReachable%28java.lang.reflect.Field%29), [`reachableMethodOverrides`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#reachableMethodOverrides%28java.lang.reflect.Executable%29), [`reachableSubtypes`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#reachableSubtypes%28java.lang.Class%29) - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.AfterCompilationAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.AfterCompilationAccess extends Feature.CompilationAccess ``` Extends: [`Feature.CompilationAccess`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md) Access methods available for [`Feature.afterCompilation`](org/graalvm/nativeimage/hosted/Feature.md#afterCompilation%28org.graalvm.nativeimage.hosted.Feature.AfterCompilationAccess%29). ## Inherited members - From interface [`Feature.CompilationAccess`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md): [`objectFieldOffset`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md#objectFieldOffset%28java.lang.reflect.Field%29), [`registerAsImmutable`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md#registerAsImmutable%28java.lang.Object%29), [`registerAsImmutable`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md#registerAsImmutable%28java.lang.Object,java.util.function.Predicate%29) - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.AfterHeapLayoutAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.AfterHeapLayoutAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.afterHeapLayout`](org/graalvm/nativeimage/hosted/Feature.md#afterHeapLayout%28org.graalvm.nativeimage.hosted.Feature.AfterHeapLayoutAccess%29). ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.AfterImageWriteAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.AfterImageWriteAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.afterImageWrite`](org/graalvm/nativeimage/hosted/Feature.md#afterImageWrite%28org.graalvm.nativeimage.hosted.Feature.AfterImageWriteAccess%29). ## Methods ### getImagePath() `Path getImagePath()`. Since 19.0. Returns the path to the created native-image file (includes the native-image file name). Cite: `org/graalvm/nativeimage/hosted/Feature.AfterImageWriteAccess.html#getImagePath()` ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.AfterRegistrationAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.AfterRegistrationAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.afterRegistration`](org/graalvm/nativeimage/hosted/Feature.md#afterRegistration%28org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess%29). ## Methods ### getReflectiveAccess() `ReflectiveAccess getReflectiveAccess()`. Returns the instance of `RuntimeReflection` used to register elements for reflection at run time. All registrations should happen in `Feature.afterRegistration`. Cite: `org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.html#getReflectiveAccess()` ### getResourceAccess() `ResourceAccess getResourceAccess()`. Returns the instance of `RuntimeResourceAccess` used to register resources for run time access. All registrations should happen in `Feature.afterRegistration`. Cite: `org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.html#getResourceAccess()` ### getJNIAccess() `JNIAccess getJNIAccess()`. Returns the instance of `RuntimeJNIAccess` used to register elements for JNI access at run time. All registrations should happen in `Feature.afterRegistration`. Cite: `org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.html#getJNIAccess()` ### getForeignAccess() `ForeignAccess getForeignAccess()`. Returns the instance of `RuntimeForeignAccess` used to register elements for foreign access at run time. All registrations should happen in `Feature.afterRegistration`. Cite: `org/graalvm/nativeimage/hosted/Feature.AfterRegistrationAccess.html#getForeignAccess()` ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.BeforeAnalysisAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.BeforeAnalysisAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.beforeAnalysis`](org/graalvm/nativeimage/hosted/Feature.md#beforeAnalysis%28org.graalvm.nativeimage.hosted.Feature.BeforeAnalysisAccess%29). ## Methods ### registerAsUsed(Class) `void registerAsUsed(Class type)`. Since 19.0. Registers the provided type a used, i.e., metadata for the type is put into the native image. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerAsUsed(java.lang.Class)` ### registerAsInHeap(Class) `void registerAsInHeap(Class type)`. Since 19.0. Registers the provided type as instantiated, i.e., the static analysis assumes that instances of this type exist at run time even if there is no explicit instantiation in the bytecodes. This implies that the type is also marked as `used`. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerAsInHeap(java.lang.Class)` ### registerAsUnsafeAllocated(Class) `void registerAsUnsafeAllocated(Class type)`. Since 24.1. Registers the provided type as allocatable without running a constructor, via Unsafe.allocateInstance or via the JNI function AllocObject. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerAsUnsafeAllocated(java.lang.Class)` ### registerAsAccessed(Field) `void registerAsAccessed(Field field)`. Since 19.0. Registers the provided field as accesses, i.e., the static analysis assumes the field is used even if there are no explicit reads or writes in the bytecodes. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerAsAccessed(java.lang.reflect.Field)` ### registerAsUnsafeAccessed(Field) `void registerAsUnsafeAccessed(Field field)`. Since 19.0. Registers the provided field as written or read by `sun.misc.Unsafe`, i.e., the static analysis merges together all values of unsafe accessed fields of a specific type. This implies that the field is also marked as `accessed`. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerAsUnsafeAccessed(java.lang.reflect.Field)` ### registerReachabilityHandler(Consumer, Object...) `void registerReachabilityHandler(Consumer callback, Object... elements)`. Since 19.2. Registers a callback that is invoked once `during analysis` when any of the provided elements is determined to be reachable at run time. The elements can only be of the following types: [`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html) to specify reachability of the given class; [`Field`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Field.html) to specify reachability of a field; [`Executable`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Executable.html) to specify reachability of a method or constructor. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerReachabilityHandler(java.util.function.Consumer,java.lang.Object...)` ### registerMethodOverrideReachabilityHandler(BiConsumer, Executable) `void registerMethodOverrideReachabilityHandler(BiConsumer callback, Executable baseMethod)`. Since 19.3. Registers a callback that is invoked once during analysis for each time a method that overrides the specified {param baseMethod} is determined to be reachable at run time. In addition, the handler will also get invoked once when the {param baseMethod} itself becomes reachable. The specific method that becomes reachable is passed to the handler as the second parameter. A method is considered reachable at run time if it can be executed, as determined via static analysis. Therefore, if a method can be statically bound (usually, that means it is final or private or static, but not abstract, or the declaring class is final), or it is a constructors, and it is the target of a reachable invoke, or it is inlined, then it is considered run time reachable. A virtual methods is considered run time reachable if its declaring-class or any of its subtypes is instantiated and the method is the target of a reachable invoke, or it is inlined. Even if the declaring type itself is not marked as instantiated the method can still be reachable via special invokes, e.g., \`super\` calls. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerMethodOverrideReachabilityHandler(java.util.function.BiConsumer,java.lang.reflect.Executable)` ### registerSubtypeReachabilityHandler(BiConsumer, Class) `void registerSubtypeReachabilityHandler(BiConsumer> callback, Class baseClass)`. Since 19.3. Registers a callback that is invoked once `during analysis` for each time a subtype of the class specified by {param baseClass} is determined to be reachable at run time. In addition the handler will also get invoked once when the {param baseClass} itself becomes reachable. The specific class that becomes reachable is passed to the handler as the second parameter. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerSubtypeReachabilityHandler(java.util.function.BiConsumer,java.lang.Class)` ### registerClassInitializerReachabilityHandler(Consumer, Class) `void registerClassInitializerReachabilityHandler(Consumer callback, Class clazz)`. Since 21.0. Registers a callback that is invoked once `during analysis` when the class initializer for the given type is determined to be reachable at run time. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerClassInitializerReachabilityHandler(java.util.function.Consumer,java.lang.Class)` ### registerFieldValueTransformer(Field, FieldValueTransformer) `void registerFieldValueTransformer(Field field, FieldValueTransformer transformer)`. Since 22.3. Registers a field value transformer for the provided field. See the JavaDoc of `FieldValueTransformer` for details. Cite: `org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.html#registerFieldValueTransformer(java.lang.reflect.Field,org.graalvm.nativeimage.hosted.FieldValueTransformer)` ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.BeforeCompilationAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.BeforeCompilationAccess extends Feature.CompilationAccess ``` Extends: [`Feature.CompilationAccess`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md) Access methods available for [`Feature.beforeCompilation`](org/graalvm/nativeimage/hosted/Feature.md#beforeCompilation%28org.graalvm.nativeimage.hosted.Feature.BeforeCompilationAccess%29). ## Inherited members - From interface [`Feature.CompilationAccess`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md): [`objectFieldOffset`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md#objectFieldOffset%28java.lang.reflect.Field%29), [`registerAsImmutable`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md#registerAsImmutable%28java.lang.Object%29), [`registerAsImmutable`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md#registerAsImmutable%28java.lang.Object,java.util.function.Predicate%29) - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.BeforeHeapLayoutAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 23.2. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.BeforeHeapLayoutAccess extends Feature.CompilationAccess ``` Extends: [`Feature.CompilationAccess`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md) Access methods available for [`Feature.beforeHeapLayout`](org/graalvm/nativeimage/hosted/Feature.md#beforeHeapLayout%28org.graalvm.nativeimage.hosted.Feature.BeforeHeapLayoutAccess%29). ## Inherited members - From interface [`Feature.CompilationAccess`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md): [`objectFieldOffset`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md#objectFieldOffset%28java.lang.reflect.Field%29), [`registerAsImmutable`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md#registerAsImmutable%28java.lang.Object%29), [`registerAsImmutable`](org/graalvm/nativeimage/hosted/Feature.CompilationAccess.md#registerAsImmutable%28java.lang.Object,java.util.function.Predicate%29) - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.BeforeImageWriteAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.BeforeImageWriteAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.beforeImageWrite`](org/graalvm/nativeimage/hosted/Feature.md#beforeImageWrite%28org.graalvm.nativeimage.hosted.Feature.BeforeImageWriteAccess%29). ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.BeforeUniverseBuildingAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 21.1. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.BeforeUniverseBuildingAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.beforeUniverseBuilding`](org/graalvm/nativeimage/hosted/Feature.md#beforeUniverseBuilding%28org.graalvm.nativeimage.hosted.Feature.BeforeUniverseBuildingAccess%29). ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.CompilationAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.CompilationAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.beforeCompilation`](org/graalvm/nativeimage/hosted/Feature.md#beforeCompilation%28org.graalvm.nativeimage.hosted.Feature.BeforeCompilationAccess%29) and [`Feature.afterCompilation`](org/graalvm/nativeimage/hosted/Feature.md#afterCompilation%28org.graalvm.nativeimage.hosted.Feature.AfterCompilationAccess%29). ## Methods ### objectFieldOffset(Field) `long objectFieldOffset(Field field)`. Since 19.0. Returns the field offset of the provided instance field. Cite: `org/graalvm/nativeimage/hosted/Feature.CompilationAccess.html#objectFieldOffset(java.lang.reflect.Field)` ### registerAsImmutable(Object) `void registerAsImmutable(Object object)`. Since 19.0. Hint to the native image generator that the given object is immutable at runtime, i.e., can be placed in a read-only section of the native image heap. Cite: `org/graalvm/nativeimage/hosted/Feature.CompilationAccess.html#registerAsImmutable(java.lang.Object)` ### registerAsImmutable(Object, Predicate) `void registerAsImmutable(Object root, Predicate includeObject)`. Since 19.0. Register the object, and everything it transitively references, as immutable. When the provided predicate returns false for an object, the object is not marked as immutable and the transitive iteration is stopped. Cite: `org/graalvm/nativeimage/hosted/Feature.CompilationAccess.html#registerAsImmutable(java.lang.Object,java.util.function.Predicate)` ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.DuringAnalysisAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.DuringAnalysisAccess extends Feature.BeforeAnalysisAccess, Feature.QueryReachabilityAccess ``` Extends: [`Feature.BeforeAnalysisAccess`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md), [`Feature.QueryReachabilityAccess`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md) Access methods available for [`Feature.duringAnalysis`](org/graalvm/nativeimage/hosted/Feature.md#duringAnalysis%28org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess%29). ## Methods ### requireAnalysisIteration() `void requireAnalysisIteration()`. Since 19.0. Notifies the static analysis that changes are made that enforce a new iteration of the analysis. Cite: `org/graalvm/nativeimage/hosted/Feature.DuringAnalysisAccess.html#requireAnalysisIteration()` ## Inherited members - From interface [`Feature.BeforeAnalysisAccess`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md): [`registerAsAccessed`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerAsAccessed%28java.lang.reflect.Field%29), [`registerAsInHeap`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerAsInHeap%28java.lang.Class%29), [`registerAsUnsafeAccessed`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerAsUnsafeAccessed%28java.lang.reflect.Field%29), [`registerAsUnsafeAllocated`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerAsUnsafeAllocated%28java.lang.Class%29), [`registerAsUsed`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerAsUsed%28java.lang.Class%29), [`registerClassInitializerReachabilityHandler`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerClassInitializerReachabilityHandler%28java.util.function.Consumer,java.lang.Class%29), [`registerFieldValueTransformer`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerFieldValueTransformer%28java.lang.reflect.Field,org.graalvm.nativeimage.hosted.FieldValueTransformer%29), [`registerMethodOverrideReachabilityHandler`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerMethodOverrideReachabilityHandler%28java.util.function.BiConsumer,java.lang.reflect.Executable%29), [`registerReachabilityHandler`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerReachabilityHandler%28java.util.function.Consumer,java.lang.Object...%29), [`registerSubtypeReachabilityHandler`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerSubtypeReachabilityHandler%28java.util.function.BiConsumer,java.lang.Class%29) - From interface [`Feature.QueryReachabilityAccess`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md): [`isReachable`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#isReachable%28java.lang.Class%29), [`isReachable`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#isReachable%28java.lang.reflect.Executable%29), [`isReachable`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#isReachable%28java.lang.reflect.Field%29), [`reachableMethodOverrides`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#reachableMethodOverrides%28java.lang.reflect.Executable%29), [`reachableSubtypes`](org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.md#reachableSubtypes%28java.lang.Class%29) - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.DuringSetupAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.DuringSetupAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.duringSetup`](org/graalvm/nativeimage/hosted/Feature.md#duringSetup%28org.graalvm.nativeimage.hosted.Feature.DuringSetupAccess%29). ## Methods ### registerObjectReplacer(Function) `void registerObjectReplacer(Function replacer)`. Since 19.0. Registers the provided function to replace objects. The function checks if an object should be replaced. In such a case, the function creates the new object and returns it. The function must return the original object if the object should not be replaced. Cite: `org/graalvm/nativeimage/hosted/Feature.DuringSetupAccess.html#registerObjectReplacer(java.util.function.Function)` ### registerObjectReachabilityHandler(Consumer, Class) ` void registerObjectReachabilityHandler(Consumer callback, Class clazz)`. Since 24.2. Register a callback that is executed when an object of type `clazz`, or any of its subtypes, is marked as reachable during heap scanning. The callback is executed before the object is added to the shadow heap. The callback may be executed for the same object by multiple worker threads concurrently. Heap snapshot verification after analysis can scan and include an object in the image heap without marking it reachable through the analysis scanner. Consequently, this callback is not guaranteed for objects first encountered through such late verification. Cite: `org/graalvm/nativeimage/hosted/Feature.DuringSetupAccess.html#registerObjectReachabilityHandler(java.util.function.Consumer,java.lang.Class)` ### registerBuildTimeBootstrapIndy(Executable) `void registerBuildTimeBootstrapIndy(Executable method)`. Since 25.4. Registers a method that is allowed to be executed at build time if called as the bootstrap method for an invokedynamic, in which case each call site outputted will be constant-folded. Other bootstrap methods will be executed at run time by default, creating the call site at run time. Cite: `org/graalvm/nativeimage/hosted/Feature.DuringSetupAccess.html#registerBuildTimeBootstrapIndy(java.lang.reflect.Executable)` ### registerBuildTimeBootstrapCondy(Executable) `void registerBuildTimeBootstrapCondy(Executable method)`. Since 25.4. Registers a method that is allowed to be executed at build time if called as the bootstrap method for a constantdynamic, in which case each call site outputted will be constant-folded. Other bootstrap methods will be executed at run time by default, creating the call site at run time. Cite: `org/graalvm/nativeimage/hosted/Feature.DuringSetupAccess.html#registerBuildTimeBootstrapCondy(java.lang.reflect.Executable)` ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.FeatureAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.FeatureAccess ``` Access methods that are available for all feature methods. ## Methods ### findClassByName(String) `Class findClassByName(String className)`. Since 19.0. Returns a class if it is present on the classpath. Cite: `org/graalvm/nativeimage/hosted/Feature.FeatureAccess.html#findClassByName(java.lang.String)` ### getApplicationClassPath() `List getApplicationClassPath()`. Since 20.2. Returns the class path of the native image that is currently built. The returned list does not include the native image generator itself, and does not include the JDK. Cite: `org/graalvm/nativeimage/hosted/Feature.FeatureAccess.html#getApplicationClassPath()` ### getApplicationModulePath() `List getApplicationModulePath()`. Since 20.2. Returns the module path of the native image that is currently built. The returned list does not include the native image generator itself, and does not include the JDK. Cite: `org/graalvm/nativeimage/hosted/Feature.FeatureAccess.html#getApplicationModulePath()` ### getApplicationClassLoader() `ClassLoader getApplicationClassLoader()`. Since 20.2. Returns the [`ClassLoader`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/ClassLoader.html) that can find all classes of the class path and module path. Cite: `org/graalvm/nativeimage/hosted/Feature.FeatureAccess.html#getApplicationClassLoader()` # ◇ Feature.IsInConfigurationAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.IsInConfigurationAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.isInConfiguration`](org/graalvm/nativeimage/hosted/Feature.md#isInConfiguration%28org.graalvm.nativeimage.hosted.Feature.IsInConfigurationAccess%29). ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.OnAnalysisExitAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.OnAnalysisExitAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.onAnalysisExit`](org/graalvm/nativeimage/hosted/Feature.md#onAnalysisExit%28org.graalvm.nativeimage.hosted.Feature.OnAnalysisExitAccess%29). ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.OnRegistrationAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 25.1.3. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.OnRegistrationAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access methods available for [`Feature.onRegistration`](org/graalvm/nativeimage/hosted/Feature.md#onRegistration%28org.graalvm.nativeimage.hosted.Feature.OnRegistrationAccess%29). ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ Feature.QueryReachabilityAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.2. Nested in [`Feature`](org/graalvm/nativeimage/hosted/Feature.md). ```java public interface Feature.QueryReachabilityAccess extends Feature.FeatureAccess ``` Extends: [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md) Access reachability methods available for [`Feature.afterAnalysis`](org/graalvm/nativeimage/hosted/Feature.md#afterAnalysis%28org.graalvm.nativeimage.hosted.Feature.AfterAnalysisAccess%29) and [`Feature.duringAnalysis`](org/graalvm/nativeimage/hosted/Feature.md#duringAnalysis%28org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess%29). ## Methods ### isReachable(Class) `boolean isReachable(Class clazz)`. Since 19.2. Returns true if the static analysis determined that the provided class is reachable at run time. Cite: `org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.html#isReachable(java.lang.Class)` ### isReachable(Field) `boolean isReachable(Field field)`. Since 19.2. Returns true if the static analysis determined that the provided field is reachable at run time. Cite: `org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.html#isReachable(java.lang.reflect.Field)` ### isReachable(Executable) `boolean isReachable(Executable method)`. Since 19.2. Returns true if the static analysis determined that the provided method is reachable at run time. Cite: `org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.html#isReachable(java.lang.reflect.Executable)` ### reachableSubtypes(Class) `Set> reachableSubtypes(Class baseClass)`. Since 19.3. Returns all subtypes of the given {param baseClass} that the static analysis determined to be reachable at run time (including the {param baseClass} itself). Cite: `org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.html#reachableSubtypes(java.lang.Class)` ### reachableMethodOverrides(Executable) `Set reachableMethodOverrides(Executable baseMethod)`. Since 19.3. Returns all method overrides of the given {param baseMethod} that the static analysis determined to be reachable at run time (including the {param baseMethod} itself). Cite: `org/graalvm/nativeimage/hosted/Feature.QueryReachabilityAccess.html#reachableMethodOverrides(java.lang.reflect.Executable)` ## Inherited members - From interface [`Feature.FeatureAccess`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md): [`findClassByName`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#findClassByName%28java.lang.String%29), [`getApplicationClassLoader`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassLoader%28%29), [`getApplicationClassPath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationClassPath%28%29), [`getApplicationModulePath`](org/graalvm/nativeimage/hosted/Feature.FeatureAccess.md#getApplicationModulePath%28%29) # ◇ FieldValueTransformer [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Interface in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 22.3. ```java public interface FieldValueTransformer ``` A transformer for a field value that can be registered using [`BeforeAnalysisAccess.registerFieldValueTransformer`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerFieldValueTransformer%28java.lang.reflect.Field,org.graalvm.nativeimage.hosted.FieldValueTransformer%29). At image build time, the field value transformer provides the value of the field for the image heap. Without a transformer, the value of the field in the image heap is the same as the hosted value in the image generator. A field value transformer allows to intercept the value. A field value transformer can, for example, reset a field to the default null/0 value, replace a filled collection with a new empty collection, or provide any kind of new value for a field. The value returned by [`transform(Object, Object)`](org/graalvm/nativeimage/hosted/FieldValueTransformer.md#transform%28java.lang.Object,java.lang.Object%29) may be cached when it is first queried for a given receiver. Consequently, later changes to the original hosted field value may not be reflected in the image heap. Only one field value transformer can be registered for each field. A field value transformer can be registered for fields of classes that are initialized at image run time. That allows constant folding of final fields even though the declaring class is not initialized at image build time. A field value transformer must be registered before the field is seen as reachable by the static analysis. It is generally safe to register a transformer in [`Feature.beforeAnalysis`](org/graalvm/nativeimage/hosted/Feature.md#beforeAnalysis%28org.graalvm.nativeimage.hosted.Feature.BeforeAnalysisAccess%29) before the static analysis is started, in a [`type reachability handler`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerReachabilityHandler%28java.util.function.Consumer,java.lang.Object...%29) for the declaring class of the field, or a [`subtype reachability handler`](org/graalvm/nativeimage/hosted/Feature.BeforeAnalysisAccess.md#registerSubtypeReachabilityHandler%28java.util.function.BiConsumer,java.lang.Class%29) for a super-type of the declaring class of the field. ## Methods ### transform(Object, Object) `Object transform(Object receiver, Object originalValue)`. Since 22.3. Transforms the field value for the provided receiver. The receiver is null for static fields. The original value of the field, i.e., the hosted value of the field in the image generator, is also provided as an argument. The type of the returned object must be assignable to the declared type of the field. If the field has a primitive type, the return value must be a boxed value, and must not be null. Cite: `org/graalvm/nativeimage/hosted/FieldValueTransformer.html#transform(java.lang.Object,java.lang.Object)` ### isAvailable() `default boolean isAvailable()`. Since 25. Returns true when the value for this custom computation is available. A transition from unavailable to available only permits `transform(Object, Object)` to be invoked; it does not itself trigger a field scan or rescan. Cite: `org/graalvm/nativeimage/hosted/FieldValueTransformer.html#isAvailable()` # ◆ RuntimeClassInitialization [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. ```java public final class RuntimeClassInitialization ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `RuntimeClassInitialization` This class provides methods that can be called during native-image building to configure class initialization behavior. By default, all JDK classes that are seen as reachable for a native image are initialized during image building, i.e. the class initialization method is executed during image building and is not seen as a reachable method at runtime. Application classes, on the other hand, are initialized during image building if they can be proven safe. Unsafe classes, e.g. ones that create threads, will be initialized at image run time. For classes that can't be proven safe, it is sometimes beneficial to ensure initialization during image building, and for some that are safe, it is still necessary to initialize at runtime (e.g., the order of initializer execution matters). This class provides two different registration methods: Classes registered via [`initializeAtRunTime`](org/graalvm/nativeimage/hosted/RuntimeClassInitialization.md#initializeAtRunTime%28java.lang.Class...%29) are not initialized at all during image generation, and only initialized at runtime, i.e., the class initializer is executed once at runtime. Classes registered via [`initializeAtBuildTime`](org/graalvm/nativeimage/hosted/RuntimeClassInitialization.md#initializeAtBuildTime%28java.lang.Class...%29) will be initialized during image building. It is also possible define initialization for whole packages with [`initializeAtRunTime(String[])`](org/graalvm/nativeimage/hosted/RuntimeClassInitialization.md#initializeAtRunTime%28java.lang.String...%29) and [`initializeAtBuildTime(String[])`](org/graalvm/nativeimage/hosted/RuntimeClassInitialization.md#initializeAtBuildTime%28java.lang.String...%29). The rules for packages can be further refined by using methods for individual classes. Initializing classes at runtime comes with some costs and restrictions: - The class initialization status must be checked before a static field access, static method call, and object allocation of such classes. This has an impact on performance. - Instances of such classes are not allowed on the image heap, i.e., on the initial heap that is part of the native executable. Otherwise instances would exist before the class is initialized, which violates the class initialization specification. - ## Methods ### initializeAtRunTime(Class...) `public static void initializeAtRunTime(Class... classes)`. Since 19.0. Registers the provided classes, and all of their subclasses, for class initialization at runtime. The classes are not initialized automatically during image generation, and also must not be initialized manually by the user during image generation. Unfortunately, classes are initialized for many reasons, and it is not possible to intercept class initialization and report an error at this time. If a registered class gets initialized, an error can be reported only later and the user must manually debug the reason for class initialization. This can be done by, e.g., setting a breakpoint in the class initializer or adding debug printing (print the stack trace) in the class initializer. Cite: `org/graalvm/nativeimage/hosted/RuntimeClassInitialization.html#initializeAtRunTime(java.lang.Class...)` ### initializeAtRunTime(String...) `public static void initializeAtRunTime(String... packages)`. Since 19.0. Registers all classes in provided packages, and all of their subclasses, for class initialization at runtime. The classes are not initialized automatically during image generation, and also must not be initialized manually by the user during image generation. Unfortunately, classes are initialized for many reasons, and it is not possible to intercept class initialization and report an error at this time. If a registered class gets initialized, an error can be reported only later and the user must manually debug the reason for class initialization. This can be done by, e.g., setting a breakpoint in the class initializer or adding debug printing (print the stack trace) in the class initializer. Cite: `org/graalvm/nativeimage/hosted/RuntimeClassInitialization.html#initializeAtRunTime(java.lang.String...)` ### initializeAtBuildTime(Class...) `public static void initializeAtBuildTime(Class... classes)`. Since 19.0. Registers the provided classes as eagerly initialized during image-build time. All static initializers of `classes` will be executed immediately at image-build time and static fields that are assigned values will be available at runtime. `static final` fields will be considered as constant. It is up to the user to ensure that this behavior makes sense and does not lead to wrong application behavior. After this method returns, all listed classes have been initialized at build time. Therefore, this method can be used to resolve deadlocks and cycles in class initializer by starting initialization with a known-good entry class. All superclasses and superinterfaces that are initialized before any of the listed classes are registered for initialization at build time too. Please look at the Java specification for the exact rules, especially regarding interfaces that declare default methods. Cite: `org/graalvm/nativeimage/hosted/RuntimeClassInitialization.html#initializeAtBuildTime(java.lang.Class...)` ### initializeAtBuildTime(String...) `public static void initializeAtBuildTime(String... packages)`. Since 19.0. Registers all classes in provided packages as eagerly initialized during image-build time. Passing `""` as a package, registers all packages and classes for initialization at build time. This might have unintended side-effects and should thus be used with great caution. All static initializers of `classes` will be executed during image-build time and static fields that are assigned values will be available at runtime. `static final` fields will be considered as constant. It is up to the user to ensure that this behavior makes sense and does not lead to wrong application behavior. Cite: `org/graalvm/nativeimage/hosted/RuntimeClassInitialization.html#initializeAtBuildTime(java.lang.String...)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ RuntimeForeignAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). ```java public final class RuntimeForeignAccess ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `RuntimeForeignAccess` ## Methods ### registerForDowncall(Object, Object...) `public static void registerForDowncall(Object desc, Object... options)`. Since 23.1. Registers the provided function descriptor and options pair at image build time for downcalls into foreign code. Required to get a downcall method handle using [`java.lang.foreign.Linker.downcallHandle`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.html#downcallHandle%28java.lang.foreign.MemorySegment,java.lang.foreign.FunctionDescriptor,java.lang.foreign.Linker.Option...%29) for the same descriptor and options at runtime. Even though this method is weakly typed for compatibility reasons, runtime checks will be performed to ensure that the arguments have the expected type. It will be deprecated in favor of strongly typed variant as soon as possible. This API is deprecated; use the `ForeignAccess` instead. Parameters: `desc` `Object`: A [`java.lang.foreign.FunctionDescriptor`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/FunctionDescriptor.html) to register for downcalls. `options` `Object...`: An array of [`java.lang.foreign.Linker.Option`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.Option.html) used for the downcalls. Cite: `org/graalvm/nativeimage/hosted/RuntimeForeignAccess.html#registerForDowncall(java.lang.Object,java.lang.Object...)` ### registerForUpcall(Object, Object...) `public static void registerForUpcall(Object desc, Object... options)`. Since 24.1. Registers the provided function descriptor and options pair at image build time for upcalls from foreign code. Required to get an upcall stub function pointer using [`java.lang.foreign.Linker.upcallStub`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.html#upcallStub%28java.lang.invoke.MethodHandle,java.lang.foreign.FunctionDescriptor,java.lang.foreign.Arena,java.lang.foreign.Linker.Option...%29) for the same descriptor and options at runtime. Even though this method is weakly typed for compatibility reasons, runtime checks will be performed to ensure that the arguments have the expected type. It will be deprecated in favor of strongly typed variant as soon as possible. This API is deprecated; use the `ForeignAccess` instead. Parameters: `desc` `Object`: A [`java.lang.foreign.FunctionDescriptor`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/FunctionDescriptor.html) to register for upcalls. `options` `Object...`: An array of [`java.lang.foreign.Linker.Option`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.Option.html) used for the upcalls. Cite: `org/graalvm/nativeimage/hosted/RuntimeForeignAccess.html#registerForUpcall(java.lang.Object,java.lang.Object...)` ### registerForDirectUpcall(MethodHandle, Object, Object...) `public static void registerForDirectUpcall(MethodHandle target, Object desc, Object... options)`. Since 24.2. Registers a specific static method (denoted by a method handle) as a fast upcall target. This will create a specialized upcall stub that will invoke only the specified method, which is much faster than using `registerForUpcall(Object, Object...)`). The provided method handle must be a direct method handle. Those are most commonly created using [`java.lang.invoke.MethodHandles.Lookup.findStatic(Class, String, MethodType)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/invoke/MethodHandles.Lookup.html#findStatic%28java.lang.Class,java.lang.String,java.lang.invoke.MethodType%29). However, a strict requirement is that it must be possible to create a non-empty descriptor for the method handle using [`MethodHandle.describeConstable()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/invoke/MethodHandle.html#describeConstable%28%29). The denoted static method will also be registered for reflective access since run-time code will also create a method handle to denoted static method. Even though this method is weakly typed for compatibility reasons, runtime checks will be performed to ensure that the arguments have the expected type. It will be deprecated in favor of strongly typed variant as soon as possible. This API is deprecated; use the `ForeignAccess` instead. Parameters: `target` `MethodHandle`: A direct method handle denoting a static method. `desc` `Object`: A [`java.lang.foreign.FunctionDescriptor`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/FunctionDescriptor.html) to register for upcalls. `options` `Object...`: An array of [`java.lang.foreign.Linker.Option`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/foreign/Linker.Option.html) used for the upcalls. Cite: `org/graalvm/nativeimage/hosted/RuntimeForeignAccess.html#registerForDirectUpcall(java.lang.invoke.MethodHandle,java.lang.Object,java.lang.Object...)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ RuntimeJNIAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 22.3. ```java public final class RuntimeJNIAccess ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `RuntimeJNIAccess` This class provides methods that can be called during native image generation to register classes, methods, and fields for JNI access at run time. ## Methods ### register(Class...) `public static void register(Class... classes)`. Since 22.3. Makes the provided classes available for JNI access at run time. Needed when native code looks up Java classes via [FindClass](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#findclass). This API is deprecated; use the `JNIAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeJNIAccess.html#register(java.lang.Class...)` ### register(Executable...) `public static void register(Executable... methods)`. Since 22.3. Makes the provided methods available for JNI access at run time. Needed when native code looks up Java methods via [GetMethodID](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#getmethodid) or [GetStaticMethodID](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#getstaticmethodid). This API is deprecated; use the `JNIAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeJNIAccess.html#register(java.lang.reflect.Executable...)` ### register(Field...) `public static void register(Field... fields)`. Since 22.3. Makes the provided fields available for JNI access at run time. Needed when native code looks up Java fields via [GetFieldID](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#getfieldid) or [GetStaticFieldID](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#getstaticfieldid). This API is deprecated; use the `JNIAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeJNIAccess.html#register(java.lang.reflect.Field...)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ RuntimeProxyCreation [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 22.3. ```java public final class RuntimeProxyCreation ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `RuntimeProxyCreation` This class can be used to make creating dynamic proxy classes at run time valid. ## Methods ### register(Class...) `public static void register(Class... interfaces)`. Since 22.3. Enables registering specifications of [`java.lang.reflect.Proxy`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Proxy.html) classes during the image build so that matching proxy objects can be created at runtime. The proxy class is fully specified by the interfaces it implements. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeProxyCreation.html#register(java.lang.Class...)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ RuntimeReflection [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 19.0. ```java public final class RuntimeReflection ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `RuntimeReflection` This class provides methods that can be called during native image generation to register classes, methods, and fields for reflection at run time. ## Methods ### register(Class...) `public static void register(Class... classes)`. Since 19.0. Makes the provided classes available for reflection at run time. A call to [`Class.forName`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#forName%28java.lang.String%29) for the names of the classes will return the classes at run time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#register(java.lang.Class...)` ### register(Executable...) `public static void register(Executable... methods)`. Since 19.0. Makes the provided methods available for reflection at run time. The methods will be returned by [`Class.getMethod`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getMethod%28java.lang.String,java.lang.Class...%29), [`Class.getDeclaredMethod(String, Class[])`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredMethod%28java.lang.String,java.lang.Class...%29), and all the other methods on [`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html) that return a single method. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#register(java.lang.reflect.Executable...)` ### register(Field...) `public static void register(Field... fields)`. Since 19.0. Makes the provided fields available for reflection at run time. The fields will be returned by [`Class.getField`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getField%28java.lang.String%29), [`Class.getDeclaredField(String)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredField%28java.lang.String%29),and all the other methods on [`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html) that return a single field. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#register(java.lang.reflect.Field...)` ### register(boolean, Field...) `@Deprecated(since = "21.1") public static void register(boolean finalIsWritable, Field... fields)`. Since 19.0. Deprecated since 21.1. Use `register(Field...)` instead. Parameter `finalIsWritable` no longer serves a purpose. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#register(boolean,java.lang.reflect.Field...)` ### register(boolean, boolean, Field...) `@Deprecated(since = "21.1") public static void register(boolean finalIsWritable, boolean allowUnsafeAccess, Field... fields)`. Since 21.0. Deprecated since 21.1. Use `register(Field...)` instead. Parameters `finalIsWritable` and `allowUnsafeAccess` no longer serve a purpose. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#register(boolean,boolean,java.lang.reflect.Field...)` ### registerClassLookup(String) `public static void registerClassLookup(String className)`. Since 23.0. Makes the provided class available for reflection at run time. A call to [`Class.forName`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#forName%28java.lang.String%29) for the name of the class will return the class (if it exists) or a [`ClassNotFoundException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/ClassNotFoundException.html) at run time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerClassLookup(java.lang.String)` ### registerAsQueried(Executable...) `public static void registerAsQueried(Executable... methods)`. Since 21.3. Makes the provided methods available for reflection queries at run time. The methods will be returned by [`Class.getMethod`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getMethod%28java.lang.String,java.lang.Class...%29), [`Class.getDeclaredMethod(String, Class[])`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredMethod%28java.lang.String,java.lang.Class...%29), and all the other methods on [`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html) that return a single method, but will not be invocable and will not be considered reachable. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAsQueried(java.lang.reflect.Executable...)` ### registerMethodLookup(Class, String, Class...) `public static void registerMethodLookup(Class declaringClass, String methodName, Class... parameterTypes)`. Since 23.0. Makes the provided method available for reflection queries at run time. The method will be returned by [`Class.getMethod`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getMethod%28java.lang.String,java.lang.Class...%29), [`Class.getDeclaredMethod(String, Class[])`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredMethod%28java.lang.String,java.lang.Class...%29), and all the other methods on [`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html) that return a single method, but will not be invocable and will not be considered reachable. If the method doesn't exist a [`NoSuchMethodException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/NoSuchMethodException.html) will be thrown when calling these methods at run-time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerMethodLookup(java.lang.Class,java.lang.String,java.lang.Class...)` ### registerConstructorLookup(Class, Class...) `public static void registerConstructorLookup(Class declaringClass, Class... parameterTypes)`. Since 23.0. Makes the provided constructor available for reflection queries at run time. The constructor will be returned by [`Class.getConstructor`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getConstructor%28java.lang.Class...%29), [`Class.getDeclaredConstructor(Class[])`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredConstructor%28java.lang.Class...%29), and all the other methods on [`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html) that return a single constructor, but will not be invocable and will not be considered reachable. If the constructor doesn't exist a [`NoSuchMethodException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/NoSuchMethodException.html) will be thrown when calling these methods at run-time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerConstructorLookup(java.lang.Class,java.lang.Class...)` ### registerFieldLookup(Class, String) `public static void registerFieldLookup(Class declaringClass, String fieldName)`. Since 19.0. Makes the provided field available for reflection at run time. The field will be returned by [`Class.getField`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getField%28java.lang.String%29), [`Class.getDeclaredField(String)`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredField%28java.lang.String%29), and all the other methods on [`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html) that return a single field. If the field doesn't exist a [`NoSuchFieldException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/NoSuchFieldException.html) will be thrown when calling these methods at run-time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerFieldLookup(java.lang.Class,java.lang.String)` ### registerAllClasses(Class) `public static void registerAllClasses(Class declaringClass)`. Since 23.0. Allows calling [`Class.getClasses()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getClasses%28%29) on the provided class at run time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllClasses(java.lang.Class)` ### registerAllDeclaredClasses(Class) `public static void registerAllDeclaredClasses(Class declaringClass)`. Since 23.0. Allows calling [`Class.getDeclaredClasses()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredClasses%28%29) on the provided class at run time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllDeclaredClasses(java.lang.Class)` ### registerAllMethods(Class) `public static void registerAllMethods(Class declaringClass)`. Since 23.0. Allows calling [`Class.getMethods()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getMethods%28%29) on the provided class at run time. The methods will also be registered for individual queries. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllMethods(java.lang.Class)` ### registerAllDeclaredMethods(Class) `public static void registerAllDeclaredMethods(Class declaringClass)`. Since 23.0. Allows calling [`Class.getDeclaredMethods()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredMethods%28%29) on the provided class at run time. The methods will also be registered for individual queries. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllDeclaredMethods(java.lang.Class)` ### registerAllConstructors(Class) `public static void registerAllConstructors(Class declaringClass)`. Since 23.0. Allows calling [`Class.getConstructors()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getConstructors%28%29) on the provided class at run time. The constructors will also be registered for individual queries. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllConstructors(java.lang.Class)` ### registerAllDeclaredConstructors(Class) `public static void registerAllDeclaredConstructors(Class declaringClass)`. Since 23.0. Allows calling [`Class.getDeclaredConstructors()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredConstructors%28%29) on the provided class at run time. The constructors will also be registered for individual queries. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllDeclaredConstructors(java.lang.Class)` ### registerAllFields(Class) `public static void registerAllFields(Class declaringClass)`. Since 23.0. Allows calling [`Class.getFields()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getFields%28%29) on the provided class at run time. The fields will also be registered for individual queries. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllFields(java.lang.Class)` ### registerAllDeclaredFields(Class) `public static void registerAllDeclaredFields(Class declaringClass)`. Since 23.0. Allows calling [`Class.getDeclaredFields()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getDeclaredFields%28%29) on the provided class at run time. The fields will also be registered for individual queries. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllDeclaredFields(java.lang.Class)` ### registerAllNestMembers(Class) `public static void registerAllNestMembers(Class declaringClass)`. Since 23.0. Allows calling [`Class.getNestMembers()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getNestMembers%28%29) on the provided class at run time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllNestMembers(java.lang.Class)` ### registerAllPermittedSubclasses(Class) `public static void registerAllPermittedSubclasses(Class declaringClass)`. Since 23.0. Allows calling [`Class.getPermittedSubclasses()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getPermittedSubclasses%28%29) on the provided class at run time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllPermittedSubclasses(java.lang.Class)` ### registerAllRecordComponents(Class) `public static void registerAllRecordComponents(Class declaringClass)`. Since 23.0. Allows calling [`Class.getRecordComponents()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getRecordComponents%28%29) on the provided class at run time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllRecordComponents(java.lang.Class)` ### registerAllSigners(Class) `public static void registerAllSigners(Class declaringClass)`. Since 23.0. Allows calling [`Class.getSigners()`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#getSigners%28%29) on the provided class at run time. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerAllSigners(java.lang.Class)` ### registerForReflectiveInstantiation(Class...) `public static void registerForReflectiveInstantiation(Class... classes)`. Since 19.0. Makes the provided classes available for reflective instantiation by [`Class.newInstance`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html#newInstance%28%29). This is equivalent to registering the nullary constructors of the classes. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeReflection.html#registerForReflectiveInstantiation(java.lang.Class...)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ RuntimeResourceAccess [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). ```java public final class RuntimeResourceAccess ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `RuntimeResourceAccess` This class can be used to register Java resources and ResourceBundles that should be accessible at run time. ## Methods ### addResource(Module, String) `public static void addResource(Module module, String resourcePath)`. Since 22.3. Make Java resource `resourcePath` from `module` available at run time. If the given `module` is unnamed, the resource is looked up on the classpath instead. This API is deprecated; use the `ResourceAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeResourceAccess.html#addResource(java.lang.Module,java.lang.String)` ### addResource(Module, String, byte[]) `public static void addResource(Module module, String resourcePath, byte[] resourceContent)`. Since 22.3. Inject a Java resource at `resourcePath` in `module` with the specified `resourceContent`. At runtime the resource can be accessed as if it was part of the original application. If the given `module` is unnamed, the resource is placed on the classpath instead. This API is deprecated; use the `ResourceAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeResourceAccess.html#addResource(java.lang.Module,java.lang.String,byte[])` ### addResourceBundle(Module, String, Locale[]) `public static void addResourceBundle(Module module, String baseBundleName, Locale[] locales)`. Since 22.3. Make Java ResourceBundle that is specified by a `baseBundleName` and `locales` from module `module` available at run time. If the given `module` is unnamed, the ResourceBundle is looked up on the classpath instead. This API is deprecated; use the `ResourceAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeResourceAccess.html#addResourceBundle(java.lang.Module,java.lang.String,java.util.Locale[])` ### addResourceBundle(Module, String) `public static void addResourceBundle(Module module, String bundleName)`. Since 22.3. Make Java ResourceBundle that is specified by a `bundleName` from module `module` available at run time. If the given `module` is unnamed, the ResourceBundle is looked up on the classpath instead. This API is deprecated; use the `ResourceAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeResourceAccess.html#addResourceBundle(java.lang.Module,java.lang.String)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ RuntimeSerialization [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 21.3. ```java public final class RuntimeSerialization ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `RuntimeSerialization` This class provides methods that can be called before and during analysis, to register classes for serialization at image runtime. ## Methods ### registerIncludingAssociatedClasses(Class) `public static void registerIncludingAssociatedClasses(Class clazz)`. Since 21.3. Register the specified serialization target class itself and all associated classes. According to the Java Object Serialization Specification, the associated classes include 1) all the target class' non-static and non-transient fields types and their associated classes; 2) other fields defined in the customised writeObject(ObjectOutputStream) and readObject(ObjectInputStream). This method can automatically explore all possible serialization target classes in the first scenario, but can't figure out the classes in the second scenario. Another limitation is the specified `clazz` must have no subclasses (effectively final). Otherwise, the actual serialization target class could be any subclass of the specified class at runtime. This API is deprecated; use the `ReflectiveAccess` instead. Parameters: `clazz` `Class`: the serialization target class. Cite: `org/graalvm/nativeimage/hosted/RuntimeSerialization.html#registerIncludingAssociatedClasses(java.lang.Class)` ### register(Class...) `public static void register(Class... classes)`. Since 21.3. Makes the provided classes available for serialization at runtime. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeSerialization.html#register(java.lang.Class...)` ### registerWithTargetConstructorClass(Class, Class) `@Deprecated(since = "24.2") public static void registerWithTargetConstructorClass(Class clazz, Class customTargetConstructorClazz)`. Since 21.3. Deprecated since 24.2. Use `register(Class[])` instead. All possible custom constructors will be registered automatically. Makes the provided class available for serialization at runtime but uses the provided customTargetConstructorClazz for deserialization. In some cases an application might explicitly make calls to `ReflectionFactory.newConstructorForSerialization(Class cl, Constructor constructorToCall)` where the passed \`constructorToCall\` differs from what would automatically be used if regular deserialization of \`cl\` would happen. This method exists to also support such usecases. Cite: `org/graalvm/nativeimage/hosted/RuntimeSerialization.html#registerWithTargetConstructorClass(java.lang.Class,java.lang.Class)` ### registerLambdaCapturingClass(Class) `public static void registerLambdaCapturingClass(Class lambdaCapturingClass)`. Since 22.3. Makes a class available for serialization at runtime that is created for the lambda expressions (a class that has a $deserializeLambda$ method) specified by the lambdaCapturingClass. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeSerialization.html#registerLambdaCapturingClass(java.lang.Class)` ### registerProxyClass(Class...) `public static void registerProxyClass(Class... implementedInterfaces)`. Since 22.3. Makes a dynamic proxy class (class that extends [`java.lang.reflect.Proxy`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/reflect/Proxy.html)) available for serialization at runtime that is specified by the given interfaces the proxy class implements. This API is deprecated; use the `ReflectiveAccess` instead. Cite: `org/graalvm/nativeimage/hosted/RuntimeSerialization.html#registerProxyClass(java.lang.Class...)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29) # ◆ RuntimeSystemProperties [nativeimage](index.md) › [org.graalvm.nativeimage.hosted](org/graalvm/nativeimage/hosted/index.md) · Every page: [llms.txt](llms.txt) Class in [`org.graalvm.nativeimage.hosted`](org/graalvm/nativeimage/hosted/index.md). Since 23.0. ```java public final class RuntimeSystemProperties ``` Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `RuntimeSystemProperties` This class provides methods that can be called during native image generation to define system property setting for image runtime. ## Methods ### register(String, String) `public static void register(String key, String value)`. Since 23.0. Define a system property setting for image runtime. This ensures a given key has the given value at runtime even if no system property is set via command line of the image execution. Cite: `org/graalvm/nativeimage/hosted/RuntimeSystemProperties.html#register(java.lang.String,java.lang.String)` ## Inherited members - From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29)