Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!
This is gonna be tricky because different java versions have different uninstall string. I would recommend to create report for all installed java versions in your environment and create applications with supersedence configured. This way, irrespective of the installed versions, SCCM will detect which old java version is installed and uninstall it before installing the newer version.
1. Create query-based report
2. Create Applications with detection method (you can do it based on uninstall registry)
3. Create supersedence.