Fix Java 7 on MacOS build issue