javax.annotation does not ship with JDK 11. Spring Security uses javax.annotation.PreDestroy in some of its LDAP tests, but such can easily be replaced with implementing DisposableBean.