Add Java 6 support

This change allows building with Java 6.