If you’ve managed to screw up your existing Java installation on Mac OS X, or you’re looking to downgrade for reason(s) best know to you, here’s a nice and easy way of preventing Mac OS X from telling you it knows best1.
Note: This method does not require Pacifist and/ or modification of the installation package in any other way.
Disclaimer: This works on Mac OS X 10.3.9. It may or may not work on Tiger. It may or may not blow up your computer. You run it at your own risk.
And finally, the method:
Step 1 (aka Duh!)
Download the version you need to install on your machine from Apple’s site.
Step 2 (aka My Lucky Day)
Run it and see if it lets you do the needful. If this step is successful, you shouldn’t have been reading this page in the first place. Thanks for wasting my bandwidth. If not, exit the installer and proceed.
Step 3 (aka The Good Stuff)
In Finder, go to folder /System/Library/Frameworks/JavaVM.framework/Resources and move the files “version.plist” and “Info-macos.plist” to a safe place like the Desktop. The moving process might prompt you for password and involve two separate transactions – copying files to the target location and then deleting them from the source.
Hope I have been successful in complicating a simple process.
Step 4 (aka Eureka)
Run the installer again and watch as it proceeds with installation. You didn’t think it would work, did you?
Step 5 (aka Double Check)
Open Terminal and type “java -version”. Is it what you just installed?
Step 6 (aka Optional)
If you answered yes to #5, it’s safe to delete the files you kept as backup. You may, however, want to keep them for reasons best known to you. Leave a comment, below, reassuring everyone that this method actually works.
If you answered no or if step 4 didn’t work for you and you are running Panther, leave a comment so I can take down this post/ blog. If you are running Tiger, please drop in a line to let all the regular readers of this blog (half a dozen Windows users) know that this technique won’t run on 10.4.
Note on disclaimer: In case you are wondering, I was kidding about the blowing up bit. This technique builds on the method described in an official Apple Technical Note. While the note says that removing one file would do just fine, my experiments showed you needed to remove both, especially if you are changing versions. Also, like I said above, you can install any version of Java intended for your OS, not just the one that came with your CD/ DVD like the note says.
Symptoms (aka when to use this method)
This method is known to fix the “Segmentation Fault” and “HotSpot not at correct virtual address. Sharing disabled.” states that some Java installations may find themselves in.
- The “installer cannot run on this machine because it does not have…” messages [↩]
[...] Clearly, the installer didn’t/ couldn’t replace some 1.5 files. I needed a way to “force reinstall” of all Java 1.4.2 files on my system. I finally found a technique which I got to work with some modifications. [...]
That installer is poorly written. It should ask you if you want to move forward anyway. Your post was extremely helpful. For that I thank you.
If this works, thank. For nonhacker with deep belief to own…bla…
It worked! Now my Mac has found it reason for updating.
Thanks
KK
Your steps worked for me as I was trying to install java from here: http://meiert.com/en/blog/20071029/java-and-lynx-for-mac/
I mean the installation finished gracefully, but when I type java -version, I still see the old version only. Has anyone had to switch to the new version manually?
I see the newly installed java 1.6 in /System/Library/Frameworks…. but I don’t see it in my Eclipse Run configuration JRE list. So I’m still stuck.
I tried on 10.4 to roll back to Rel6 from Rel 7 because java web start apps were just sitting at “Application starting” after the autoupgrade to Rel 7. It will get past that and actually try to start the app, but now I get an unexpected error, exception, java.lang.reflect.InvocationTargetException error
Thank you, it ran for me under Leopard (10.5.5) for java 10.5 update 2.
It solved the strange behavior of Java on my system : any java application that I compiled performed well but eclipse and blueJ crashed. Only Netbeans was not affected.
Thanks again.
Worked like a charm with 10.4.11 and the excellent Pacifist freeware. I was looking at a reinstall for a machine with OSX server and and so was not looking forward to the hours of down time and waves of moaning. Thank you!
Worked excellently for 10.4.11 to replace the last Java update. Had to downgrade to 1.5 to run some Java apps fully. Thanks for posting this!
I had a sound problem with Java, and I did what you said and now I don;t have java on my Mac AT ALL! It’s gone, no matter how many times I re-install it… I don’t know what to do!
[...] Become a sheriff | Stop the Force Gaming opinions: Unreal (A Force for Good) Students forced to leave rooms two weeks before exams It’s not worth all this build up. – Temerity JaneA look at Cigar Press Magazine | The Stogie ReviewTaking a swim in the Devil’s Pool | Oddity Central Maximize Productivity #2: Forced Efficiency : Getting Things DoneKunal Dua » Blog Archive » How to force reinstall Java on Mac OS X [...]
Thanks mate, delete java 1.6 and the installer did not extract Java 1.6. Spent 3 hours before doing what you mentioned – and voila successful!!
Thank you very much.
Thanks so much!! I was really afraid I was gonna have to reinstall the os XD
I was wondering if you could maybe help me on something else too. The reason I got into this mess in the first place is I can’t seem to run Java Applets on this account; it worked fine when I created a guest account, but I’d really prefer if it worked on this one… I’ve been using this page: http://www.javatester.org/version.html and all I see is a coffee cup and two arrows…
Any help is welcome! Thanks
worked perfectly on OS 10.4.11. Thanks.
Worked perfectly on 10.5.7. Thanks!
Nope. I followed the instructions but I still have version 1.6.0_13 on 10.5.7.
This method worked perfectly for my mac. I am running OS X10.4.11 and JAVA 6 installed just fine. I just needed to go back to Applications/Utilities/Java/ Java SE6 and make Version 6 the default and drag it to the top of the java versions list. Success is sweet especially since this means I don’t need to upgrade to Leopard which is having problems of its own.
YEAH YOU ROCK!
Thank you very much Kunal for your generous Java fix. Today, there was an intel update and safari update on my macbook. Since then, safari has been crashing like mad. I should’ve never authd the update. Still trying to work on a fix for that. Please email me if you know of one. Anyways, I deleted java files in the process. Thanks for the fix once again!
How do I reset my password?
Thanks
John Musca
John Musca
[...] [...]
Does anyone know whether this process work for Snow Leopard? (10.6)
You can definitely give it a shot and as long as you backup the files mentioned in Step 3, you have nothing to lose. At worst, it won’t work – can’t mess with your system.
Do let us know how it goes!
I’ve tried the whole process and it happened as you described, but…
When i open java preferences, i manage to set version 1.6.0 on top of java application runtime settings, but above on the same window i only have option for J2SE 1.4.2 and 1.5 – shouldn’t there be 1.6 there as well?
I still don’t have this right
Help, please…
Thank you so much so far!
Hi Pietro
I am not sure I understand where you’re stuck. What do you see when you type “java -version” in Terminal? You can even test your Java installation by visiting this page:
http://java.com/en/download/help/testvm.xml
This is what i get:
java version “1.6.0-dp”
Java(TM) SE Runtime Environment (build 1.6.0-dp-b88-34)
Java HotSpot(TM) Client VM (build 1.6.0-b88-17-release, mixed mode, sharing)
What i described before is what i see in the preferences window of java.
So what’s the problem you are facing? Did you test java by visiting the URL I mentioned above?
I’ve visited the URL you recommended. I think i’m not getting the applet i should on that page. On the top of the page says:
This article applies to:
* Platform(s): Solaris SPARC, Solaris x86, Red Hat Linux, SUSE Linux, Windows 7, Vista, Windows XP, Windows 2000, Windows 2003, Windows 2008 Server, Windows ME, Windows 98, JDS
* Browser(s): Internet Explorer, Firefox, Mozilla, Netscape
* Java version(s): 1.4.2_xx, 1.5.0, 6.0
Then there is a large blank space followed by
Get Java Installation Help Now
Printable VersionPrintable Version
How do I test whether Java is working on my computer?
This article applies to:
* Platform(s): Solaris SPARC, Solaris x86, Red Hat Linux, SUSE Linux, Windows 7, Vista, Windows XP, Windows 2000, Windows 2003, Windows 2008 Server, Windows ME, Windows 98, JDS
* Browser(s): Internet Explorer, Firefox, Mozilla, Netscape
* Java version(s): 1.4.2_xx, 1.5.0, 6.0
If your applet is not displaying properly, please check these additional configurations.
1. Enable Java through your Web browser
2. Enable Java through the “Java Plug-in Control Panel”
3. Clearing your Web Browser Cache
If you are unable to perform any of the steps above due to an error, please reinstall Java. Download and installation instructions
I’ve cleared my cache and all, but don’t understand how to test java on my mac.
My question is: when i open the java preferences window, shouldn’t i see J2SE 1.6.0 as an option?
I have only 2 options: J2SE 1.4.2 and J2SE 5.0 – i’ve selectec 5.0
But on the little case further down the window i have also 1.6.0 – which i can drag to the top of the list.
Should i delete any temporary files. I really don’t want to mess this up.