Fix building with recent openjdk