Fix java version check, and use scope filter