开发者

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

开发者 https://www.devze.com 2023-01-20 19:19 出处:网络
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!

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开发者_JS百科 that I installed. Eclipse acts as if there is no JDK available on the system.

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

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

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

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

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

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.

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

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!

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

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.

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

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.

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

How do I make Windows XP machine stop trying to use uninstalled Java 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.


You could also maybe try disabling the service from starting.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号