Move to Java 8 for Java bindings.

- also, make function2 file private