Minimal changes to build successfully with Java 8, plus optional profile to enable it