简体   繁体   中英

How do I make Windows XP machine stop trying to use uninstalled Java JDK (1.6.0_13)

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.

替代文字

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... )

替代文字

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

替代文字

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.

替代文字

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!

替代文字

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.

替代文字

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.

替代文字

替代文字

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.

您也可以尝试禁用启动服务。

Copied from my repost of this quesiton on www.superuser.com:
https://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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM