fix java detection
fix parallel build bug