Fix compilation and execution error on Java 1.7