main: add openjdk6 compatibility
enable with LEGACY_USE_OPENJK6