GraalVM for example places heavy restrictions on reflection usage. It also performs aggressive tree-shaking to include only those classes and methods that are actually going to be executed. Corresponding measures are required for several common libraries to be compatible with GraalVM.
Hotspot's AOT is promising and doesn't have those pitfalls, but has not yet been delivered.