views:

46

answers:

3

My Windows XP workstation at the office had several old versions of the Java JDK installed on it. Today I decided to install the newest Java JDK and uninstall the older ones. BIG MISTAKE APPARENTLY!

I don't understand why, but XP seems to think that one of the removed JDK installations is the one that it wants to use. Not sure if it is relevant, but it was JDK 1.6.0_13. I uninstalled it earlier using the XP "Add or Remove Programs" from the Control Panel. The JDK folder is gone (as one would expect) but apparently not forgotten. Here are the symptoms:

Eclipse will no longer start up and use the new JDK that I installed. Eclipse acts as if there is no JDK available on the system.

alt text

When I type java -version at a Command Prompt I get the following response:
Error: could not open `C:\jdk1.6.0_13\jre\lib\i386\jvm.cfg'
(Gee thanks. I never would have guessed that the uninstalled JDK could not be found...)

alt text

When searching around on the machine I found a system service named "Java Quick Starter" that is pointing to the removed JDK directory.

alt text

Now I know what some of you are probably thinking. He has a JAVA_HOME system variable pointing to the old location and/or has the old location in his PATH system variable. Not the case! There are no system variables that reference this old JDK and neither does my PATH. In fact, I have already defined a new JAVA_HOME for the new JDK that I installed this morning and added it to the system PATH. I was sure that would at least give me success from the Command Prompt, but no luck.

alt text

And in case you're wondering if I have rebooted after the install/uninstall/system variable changes, yes I have.

QUESTION
Does anyone know what I did wrong here? How do I purge these references to the uninstalled JDK from my system so it can start using the newly installed one?

EDIT 1

I checked the registry as duffymo suggested. There was some stuff under HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft that did not look right. An entry still existed for the 1.6.0_13 JDK that I had deleted, and a number of the newer JDK installs had entries here with their JavaHome attribute set to the path for the old 1.6.0_13 JDK for some inexplicable reason!

alt text

I uninstalled all of the JDKs on the machine, but still there is a remnant of the old 1.6.0_13 JDK in this registry section.

alt text

Also, a 1.6.0_21 JRE is still listed in the Add and Remove Programs list that gives an error if I try to uninstall it. That one is also shown in the registry and has a registry "JavaHome" key with a value that points to the no-longer-existing JDK 1.6.0_13.

alt text

alt text

+1  A: 

Check the registry to see if something is hanging around there to point to the old JRE.

Look at HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft. You'll see Java Development Kit and Java Runtime Environment there. See what they say.

Now that you've found that the registry values are incorrect, I'd recommend either modifying them to point to the correct values OR remove them, uninstall the JDK, and reinstall.

Don't forget to accept my answer if this fixes your problem.

duffymo
There are a pile of entries under HKEY_CLASSES_ROOT\CLSID. The main entry has a cryptic key name (looks like a long string of hex characters and dashes) with an entry branching from it with the key "InprocServer32". So there is definitely something hanging around in the registry, but I'm not sure what these entries represent.
Jim Tough
See the edits above. There was some garbage in there.
Jim Tough
The details of what I did to resolve this are in my answer posted below. I'll accept your answer since you pointed me in the direction of the registry and that seems to be where the problem was occurring. Thanks!
Jim Tough
A: 

You could also maybe try disabling the service from starting.

ferrari fan
I just deleted the service and rebooted. It made no difference.
Jim Tough
A: 

Copied from my repost of this quesiton on www.superuser.com:
http://superuser.com/questions/203143/cannot-install-java-jre-on-windows-xp-workstation-possibly-due-to-previous-faile

I tried CCleaner on the registry, but it didn't solve the problem. I was feeling pretty desperate at that point and decided to search the registry with regedt32 for instances of "jdk1.6.0" and delete everything that was obviously garbage. Any registry references to JDK/JRE instances that I knew no longer existed got deleted. Usually this meant deleting the whole key, but there were a few keys where I just had to delete an individual value/data pair. I rebooted after I was done performing meatball surgery on my poor defenceless registry.

DISCLAIMER: I don't recommend that anyone start messing with random keys in their registry as the primary way to solve a problem! This was my last resort before considering the option of re-imaging my workstation and re-installing EVERYTHING.

Having said that, this approach did solve my problem. I was able to install the JRE and then things like Eclipse started working normally once again. I next installed a JDK of the same version without incident.

Jim Tough
Installing a JDK will also install the JRE of the same version. It's not necessary to install them separately.
R. Bemrose
Under normal circumstances, yes. Part of this issue was that any JDK installation would silently fail to install the public JRE.
Jim Tough