Recently I encountered a Java error, that caught me completely unguard. First I tried to remove it through Add/Remove Programs on Windows, then I just deleted folders, but program didn't disappear. On contrary, I started to receive error displayed on image below.
So as I neither could delete program nor reinstall it.
I tried different scenarios, but only one helped. I looked up questions about this error on SO and found some where it was explained, that there might be entries in registry which tell system, that Java is still installed.
If I'm correct now, then those were this questions:
I created my personal *.bat file from code brought up in answer: http://goo.gl/1gwEi
NB! I use Windows 7 x64 and it helped me just fine.