Thursday, May 03, 2007

Downgrade default JRE on windows XP

When installing Blackberry signature keys yesterday, I need to downgrade my default JRE on windows XP from 1.6 to 1.5. (Java is so good at maintaining backward compatibility, I seriously want to figure out what made the installation process not working in Java1.6. If you have a clue, please comment. Thanks.)

The complexity of this process caught me off guard. As a linux user, I instinctively went to My Computer --> Properties --> Advanced --> Environment Variables, and set the pathes. It doesn't work this way though. (Gentoo users, enjoy your java-config util and laught at me)

After some digging, here are the steps worked for me.

  1. Copy java.exe, java2.exe, javaws.exe from C:\Program Files\Java\jdk1.5.0_??\bin to C:\WINDOWS\system32\ to overwrite existing 1.6 version files.
  2. Open registry editor, goto Start --> Run, type in "regedit" and enter.
  3. Do a search for "JavaSoft", you should find something under HKEY_LOCAL_MACHINE -->SOFTWARE --> JavaSoft --> Java Runtime Environment, modify "CurrentVersion" key to "1.5" or the version you want.
  4. Update the correspondent environment variables.

4 comments:

Ben said...

Thanks a lot, this saved me from having to uninstall/reinstall to downgrade then uninstall and reinstall back to 1.6.

The article is as true today as when it was written :)

Troy said...

Hi,

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading.

Nice blog. I will keep visiting this blog very often.

-
Blackberry development

Jekin said...
This comment has been removed by the author.
Jekin said...

Just wondering, why you couldn't remove Java 6 from Control Panel->Add or Remove Programs? I just installed Java 1.5.0_22 then removed Java 6. Then go to this site:
http://www.java.com/en/download/installed.jsp
I see my Java version is 1.5.0_22