DEV Community

Discussion on: Building a 22 Megabytes Microservice with Java, Javalin and GraalVM

Collapse
 
birdayz profile image
Johannes Brüderl • Edited

I quote from GraalVM docs:

SubstrateVM tries to resolve these elements through a static analysis that
detects calls to the reflection API. Where the analysis fails the program
elements reflectively accessed at run time must be specified 
during native image generation in a configuration file [...]

So yeah it's best-effort only, but no guarantee to detect your stuff. Reflection is a hacky side-step to manipulate or create objects etc, so no guarantees. Javac can't give you guarantees about runtime behavior of reflection, so GraalVM can't do it as well.