To compile such an applet, you must include the appropriate JAR file in your classpath at compile time. At runtime, the browser supplies its own version of this file since it must be present in the browser-provided classpath to be run as trusted code. The exact name of this JAR file varies. For Netscape 4.x, it is <netscapehome>/java/classes/java40.jar. Netscape 7 does not include the file in its own path, deferring to the Java Web Start (see Recipe 23.13) to provide it. In this case, look for the file netscape.jar in your Java runtime; on Mac OS X, the file is /Library/Java/Home/lib/netscape.jar.
This technique may not work with browsers such as KDE Konqueror, which use an external JVM to run applets.
Example 18-4. JScript.java