How do I downgrade Java on OSX 10.6.8?

If anyone still cares about downgrading Java on Snow Leopard, the answer that advises removing Java manually and reinstalling from download or Snow Leopard DVD doesn't work for Snow Leopard, but it can be made to work.

Instead of using the freestanding Java packages on the DVD, use the app Pacifist to open the main Snow Leopard installer .pkg. Then search for "java" and install every item that matches (you can skip the JavaScript items, obviously). This fixes the error reported in the linked article (which is offline but available at archive.org):

"Error occurred during initialization of VM Unable to load native library: libjava.jnilib"

Apparently there are additional pieces to a functioning Java install not included in the separate .pkg files.


This article has a pretty good answer as long as you still have your boot disk or can find a downloadable version of Java you need. Here are the instructions (copied and pasted from the article):

1 Recommend making a bootable backup before starting

2 Locate the required Java installers

 - Leopard: download update 5
 - Snow Leopard: grab your install DVD

3 Remove current installed java stuff (warning: no going back from this point on!). In terminal:

 sudo rm -R /Applications/Utilities/Java\ Preferences.app/
 sudo rm -R /System/Library/Frameworks/JavaVM.framework/
 sudo rm -R /System/Library/Java/
 sudo rm -R /System/Library/CoreServices/Jar\ Launcher.app
 sudo rm -R /System/Library/CoreServices/Java\ Web\ Start.app/
 sudo rm -R /System/Library/CoreServices/JavaVersion.plist
 sudo rm -R /System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/
 sudo rm -R /System/Library/Frameworks/JavaEmbedding.framework/
 sudo rm -R /System/Library/CFMSupport/StubLibraries/JavaEmbeddingLib/

4.1 Reinstall java: Leopard

 - run the installer that you downloaded in step 1
 - restart

4.2 Reinstall java: Snow Leopard (haven't tested yet! but should work)

 - insert installer DVD
 - run terminal commands (change the paths in each command as necessary for both the OS X Install disc and your system hard drive):
      installer -verbose -pkg "/Volumes/Mac OS X Install Disk/System/Installation/Packages/Java.pkg -target /Volumes/Macintosh HD"
      installer -verbose -pkg "/Volumes/Mac OS X Install Disk/System/Installation/Packages/JavaTools.pkg -target /Volumes/Macintosh HD"
 - (alternately you can use a tool like Pacifist to browse for and run the Java.pkg and JavaTools.pkg installers located in the main .pkg installer)
 - restart

Note: we have confirmed this works for Leopard but haven't verified for Snow Leopard yet.


I don't know if this is useful, but here you go!
http://support.apple.com/kb/HT5559

Summary:

  1. Open Terminal, located in the Utilities folder.

  2. Enter this command, then press the Return or Enter key:

    sudo mkdir -p /Library/Internet\ Plug-Ins/disabled

  3. Enter this command, then press the Return or Enter key:

    sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled

  4. Enter this command, then press the Return or Enter key:

    sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin

  5. To re-enable Java SE 6 Web Start, enter this command, then press the Return or Enter key:

    sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws