Sync java handling back with FreeBSD