Aelfred parser is non validating
You may need to remove some java packages but most of them should be happy once you have the Sun JDK packages installed.You may want to follow one of these cleanup tips once you are done removing packages.
It was all over the news and the internet that a US government agency strongly discourages the use of Java due to multiple critical vulnerabilities.
You don't have a Java Runtime Environment installed, then there's no way to run any java application.
I built those commands one by one, then piped it all together and I ran all of them in different Java installation scenarios that I have for test purposes in some workstations at work.
I really paid attention to the output of Although the presented sequence of commands works on most cases, I think my answer needs some improvements.
Everybody, please, feel free to suggest changes that can improve it, like better explanation of each command or pointing out a scenario not covered by them.+1 for the answer.
I recently found a scenario where removing openjdk causes installation of other java packages.