Fix java build on mac.