If you have been having problems with Java, and you have followed some of the instructions on the forums you may find that you no longer can get Java to install because of an error.
When you attempt to run the java installer file you receive the message:
This software has already been installed on your computer. Would you like to reinstall it?
When you click Yes to the above question you receive the error:
This action is only valid for products that are currently installed.
This problem is caused because the Windows Installer information for a previous installation of Java has been removed or damaged, but the related registry keys are still present causing the Java installer to think it is already installed.
This problem can be caused if you used the "Windows Installer Cleanup Utility" to remove the Java entries without first uninstalling Java properly.
To fix this problem you must remove the two places in the registry that the Java installer looks at in order to determine if it is already installed. By removing these entries, the Java installer will begin a new installation instead of attempting to repair the old corrupt installation.
Updated Jan. 22, 2011 -- Created an automatic fix in executable form.
Please download and run this automated tool to fix the Java MSI problem on all versions of windows: JavaMSIFix
NOTE: The batch file method listed below no longer works on Windows XP in many circumstances due to a limitation in command line parameters supported by Windows XP.
Updated Feb. 26th, 2010 -- Created a universal fix for all versions of Java 6
*** Please use the automated executable listed above instead of this batch file. ***
This problem is confirmed in Windows XP, Windows Vista, and Windows 7.
Because the registry keys that need to be removed are different for each version of Java, I have created a batch file you can download to find and remove the entries automatically.
Here's how to fix Java:
- If you are able, uninstall all previous versions of Java in add/remove programs in your control panel.
- Next, you may download the current version of Java here: http://java.com/en/download/manual.jsp
I recommend that you use the offline installer version. - Now, download the fix:
Open the fixjava.zip file, extract and run the file fixjava.bat . If you are using Windows Vista, or Windows 7 you must right-click the fixjava.bat file and choose "Run As Administrator". If you do not see the run as administrator option, drag the fixjava.bat file to your desktop and then try to run as administrator from there.
The batch file will run briefly without confirmation.
- You may now install Java without any errors about it already being installed.
The contents of the batch file are listed below:
reg query hklm\software\classes\installer\products /f "java(tm) 6" /s | find "HKEY_LOCAL_MACHINE" > deljava.txt
for /f "tokens=* delims= " %%a in (deljava.txt) do reg delete %%a /f
del deljava.txt
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\wow6432node\JavaSoft\Java Runtime Environment" /f
This fix will work on Windows XP under certain cirumstances, Windows Vista, and Windows 7 for both 32-bit and 64-bit versions of the Java 6 runtime environment.
If you have any further issues please post a reply in this thread.
There are not enough words in the English language for me to properly express the fathom of gratitude that I wish to express towards you for this post, and your work.
I have wasted several days frantically searching google page after google page of message board posts that all led me to nothing but more frustration.
I do not know how I managed to stumble upon this message board, or even this specific post, but I am so glad that I did that I decided to create an account simply to Thank You!
I will definitely be sticking around here for a while as this message board appears to be loaded with lots of useful information, and helpful people much like yourself.
Kudos to you good sir, kudos.