Resolve build issues on Oracle JDK8