SENTRY-231: Fix JDK 6 build

(Ruiming Zhou via Jarek Jarcec Cecho)