I'm not talking about a sophisticated Java app here. Just hitting the "Do I have Java?" test page on Java.com will crash Firefox and pretty much any Mozilla-based browser left with the default Java configuration.

Here's what the default (and incorrect) Java configuration looks like on pretty much every version of Firefox since 3.5. You can see it by typing about:config in the URL bar, acknowledge the warning, and filter on "java" (click for larger view):

Stating that the default Java configuration is incorrect, really means that it's set to use the old Java plugin and (in most cases) a rather old version of Java. This plugin that is configured by default is incompatible with Firefox 3.5 and beyond. The first generation Java plugin is called javaplugin_oji and cannot be used with any modern version of Firefox.

Unfortunately, even the latest Firefox
(14 at the time of this post) comes configured to use the old Java plugin by default.

This means that if you're trying to run a Java-based app on anything greater than Firefox 3.5, you'll wind up with a crashed app and a core file a few seconds after the browser tries to start Java.

If you've been frustrated by not being able to run Oracle Forms-based apps, WebEx, or any other Java-based browser app on Solaris or Oracle Linux, follow the instructions below. If you're an Oracle Forms user, get ready for smoking fast response time sans MS Windows and IE.

First things first, learn the name and location of the "second generation" Java plugin. The second generation Java plugin is called libnpjp2.so and is located in:

<path to java>/jre/lib/i386/ for x86 based machines

<path to java>/jre/lib/sparc/ for SPARC based machines.

NOTE: The second generation Java plugin was introduced in Java 1.6 update 10. Ensure that you aren't running an older version of Java, if you are upgrade. Solaris 10 U9 ships with 1.4.2_26, so that will need to be updated in order to access Java-based apps with Firefox 3.5 or greater.

TIP: Sun Ray Software and Oracle VDI always ships with a relatively recent Java release. An administrator can symlink these installations to /usr/java. This will ensure that the browser's Java configuration will always be as current as the JRE used with Sun Ray Software or Oracle VDI, even across upgrades of those products.

For a Sun Ray Server:

rm -rf /usr/javaln -s /etc/opt/SUNWut/jre /usr/java

For a Oracle VDI server:

rm -rf /usr/javaln -s /opt/SUNWvda/java /usr/java

Note: The remainder of these instructions assume the following three things:

Note: Do not "copy" the library to the plugins directory, this will not work. The plugin is dependent on the relative path of where it resides. This is different than other plugins that you may be used to installing such as Acrobat Reader or Flash.

1.3) Remove any symlinks that point to the old java plugin.

rm /opt/firefox/plugins/libjavaplugin_oji.so

Note: Some sites may use a personal
plugins directory. If so, be sure to remove any symlinks for
libjavaplugin_oji.so from $HOME/.mozilla/firefox/*.default/plugins

1.4) Test. At this point, accessing the "Do I have Java" test page from java.com will now
succeed and tell you are using the second generation plugin, but certain apps, such as Oracle Forms and WebEx, will still fail.

Now that the correct second generation plugin correctly linked to the Firefox plugins directory, it's time to tell Firefox the name of the plugin and the
location of Java.

Step 2) Configure Firefox with the location of Java and the name of plugin

Note: This step needs to be done by each user who has ever ran Firefox with the old Java configuration.

2.1) Open Firefox2.2) Type "about:config" in the URL bar and acknowledge the "I'll be careful" warning
2.3 ) In the Filter Box, type java and hit return
2.4) Set both
java.default_java_location_others and java.default_java_location_solaris to:
/usr/java2.5) Remove/blank out the existing entry under
java.global_java_version_file (as the file referenced there does not exist)
2.6) Set the java.java_plugin_library_name to libnpjp2 (or libnpjp2.so, either will work)
2.7) Remove/blank out the existing entry under
java.private_java_version_file (as the file referenced there does not exist)
2.8) Close and re-open firefox. Enter about:config in the url and ensure
the settings took place.

The about config screen should now resemble this picture (click for larger image):

2.9) Test out a Java based app, such as WebEx or Oracle E*Business Suite (EBS uses Oracle Forms). The applications should work correctly, and more importantly, firefox should not crash anymore. At least not due to an incorrect Java plugin configuration!

Step 3)
Create default Firefox preferences file for new users

This will prevent first time users of Firefox
(or those who wanted to create a new profile) from having to perform the actions in Step 2. To do this, the administrator creates (or appends to the contents of) a file called prefs.js under the firefox default profiles directory and fills out these values for all new users.

3.1) Create the default profile directory, if one does not exist under /opt/firefox/defaults/