I would ;
1)Get REVO Uninstaller (you can use portable if you like) and remove any JAVA programs and make it search registry for entries and delete them all (moderate mode is fine)
2) run CCLEANER, goto Registry and scan for issues, then clean registry, fixing problems.
3) get Latest (or not) version of Java you want to get from official web site, and install it
you could also try to use the Java Uninstall tool from the web site if you cannot find java in your programs listing uninstall screen
Java Uninstall Tool for Windows :
https://java.com/en/download/uninstalltool.jsp
I don't know why you would want 5 or 6, get 7 on XP it will be fine, its version 8 you cannot install on Xp
How do I install Java ...