skip to content

Reachability Metadata & RuntimeHints

How Spring declares what the native build cannot infer: the registrar API, the hint categories, the declarative annotations, the community metadata repository, and the reflective processor mechanism. Practical knowledge for anyone who has actually shipped a native image.

part ofSpring Frameworkoverview, primer and where to startread it →
on this pageshow

explore

questions

page 2 of 2

What is the ClassLoader parameter of registerHints for, and how do you decide between a RuntimeHintsRegistrar, @RegisterReflectionForBinding, and a BeanRegistrationAotProcessor?

level: principalimportance: nice to knowfreq 20%

basics

~20 s

The ClassLoader lets you register hints conditionally — e.g. only if an optional dependency is on the classpath (ClassUtils.isPresent). Choose @RegisterReflectionForBinding for simple binding types, RuntimeHintsRegistrar for general programmatic hints, and a BeanRegistrationAotProcessor when hints must be derived per bean during AOT.

open as a page

showing 31–31 of 31