Reflection lets a program inspect or access elements such as classes and methods through metadata instead of relying only on statically referenced code. In native compilation, this runtime flexibility creates a packaging requirement: the native-image builder must know reflectively accessed classes before producing the executable. section 2.7.2 section 12.1.8
Native Quarkus applications handle reflection through advance registration and build-time integration:
- Register application classes explicitly with @RegisterForReflection when native mode needs their reflection metadata. section 12.1.8
- Prefer Quarkus extensions for integrated libraries and frameworks; extensions can detect reflectively used classes and register them automatically. section 2.7.2 section 12.1.8
- Treat missing registration as a native-build or runtime compatibility concern, even when the same code works on a regular Java runtime. section 2.7.2 section 12.1.8
Registering reflective access
An application class accessed reflectively can be marked with @RegisterForReflection before compiling a native executable. When the class belongs to a supported library or framework, a Quarkus extension can provide the equivalent registration during build-time processing, avoiding manual configuration. section 12.1.8 section 2.7.2












