Configuring MS Internet Explorer and Netscape Navigator to use JavaSoft's JFC/Swing packages 03 November 1998 Phillip Thorne I. Microsoft Internet Explorer 4.x A. Exploding swing.jar B. RegEditing the system classpath II. Netscape Navigator 4.x I. Microsoft Internet Explorer 4.x There are two ways to enable support for JFC/Swing applets in MSIE: exploding the JavaSoft-providing swing.jar into the Windows system-wide classes directory, or placing the unexploded JARfile in that directory and altering the system classpath with RegEdit to point to it. (Both methods require you to restart IE so it'll recognize the changes.) The latter, more dangerous route, is explained in the MS support article "Troubleshooting Java Problems in Internet Explorer" (ID#Q168806) at: http://support.microsoft.com/support/kb/articles/q168/8/06.asp?FR=0 I.A. Exploding swing.jar Unlike Netscape Navigator, IE doesn't contain its own classes directory. Instead, it uses the same one as the rest of Windows. This is located (on NT4.0) at: C:\NT40\Java\Classes\ This directory by default houses a file, classes.zip, which contains the core Java packages (java.lang, java.awt, etc.). The default system classpath, C:\NT40\java\classes\classes.zip;C:\NT40\java\classes;. points to that file, to the directory itself, and to the current directory "dot". "Java Archive" JARfiles, like the older-style classes.zip, are simply ZIP-compressed files with an internal directory structure, and can be unarchived with a tool such as WinZip. If you explode swing.jar into the Classes\ directory, the package directory structure will then be in the right place for IE to find all the Swing classes. The tree will look something like this: C: +-NT40 | +-Java ... | +-Classes | +-com | | +-sun | | +-java | | +-accessibility | | +-swing | | +-border | | +-event | | ... | +-Meta-inf <-----------------(ignore this) +-Lib +-Packages +-TrustLib You can ignore the Meta-inf\ directory; it contains a file called manifest.mf that lists certain statistics about the contents of the JARfile. If you exploded swing.jar from the new 1.1beta3 release of JFC/Swing, your directory structure would reflect JavaSoft's altered package naming scheme, and would look like this: C: +-NT40 +-Java | +-Classes | +-javax | +-accessibility | +-swing | +-border ... ... In fact, you can explode *both* JARfiles, because the directory trees don't overlap. You can follow a similar procedure to locally install any other third-party packages, such as KLGroup's, Netscape's IFC (Internet Foundation Classes), Neuron Data's, Symantec's, etc. I.B. RegEditing the system classpath If you don't want to mess up the Windows Classes\ directory with a package directory structure, you can risk editing the system Registry instead, with the RegEdit program (Start->Run->Open=regedit). That classpath referenced above is stored under the key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM\Classpath You can modify the key's value to something like: C:\NT40\java\classes\classes.zip;C:\NT40\java\classes\swing.jar; C:\NT40\java\classes\swing11b3.jar;C:\NT40\java\classes;. which adds swing.jar (pre-1.1beta3) and swing11b3.jar (which is how I renamed the swing.jar in the 1.1beta3 release), so IE can run applets importing *both* the old com.sun.java.swing and new javax.swing namespaces. (Remember, the value is a single unbroken line; it's split here for legibility.) The whole procedure, for IE 3.x and 4.x, Windows 95 and NT, is explained by Microsoft Support at: http://support.microsoft.com/support/kb/articles/q168/8/06.asp?FR=0 II. Netscape Navigator 4.x It's much easier to enable Swing support in Navigator; you just have to insert the necessary JARfiles in its classes directory: C:\Program Files\Netscape\Communicator\Program\Java\Classes\ It doesn't matter what you name the JARs; Navigator's JVM (Java virtual machine)will search them until it finds any necessary packages. This makes it possible to run both pre- and post-1.1beta3 Swing applets: just install both swing.jar (with the old com.sun.java.swing packages) and swing-11b3.jar (with the new javax.swing packages). Don't explode the files! Like IE, however, Navigator will recognize changes to the directory only with a program restart.