Java applets are typically run within a Web browser. As of July 1996, most of the popular Web browsers on the market support embedded Java applets in HTML pages. These browsers include:
- Sun HotJava 1.0
- Netscape Navigator 2.0 (or greater)
- Microsoft Internet Explorer 3.0
- Oracle PowerBrowser 1.5
Of course, the Applet Viewer tool included with the Java Developer's Kit can be used to test and run Java applets as well. However, it will not be included on all client machines; therefore, it is not really an option to applet developers. Many beginning Java developers wonder how an applet can run within a browser if the Java runtime libraries are not installed on the client system., "Installing Java," it was first necessary to download the JDK from the JavaSoft Web site. After installing the JDK on the system, the reader could then run any sample Java applet included with the JDK. However, someone installing the Netscape Navigator, for instance, has not downloaded the JDK, right? In fact, they partially have. Take a look at the actual Navigator installation to find out what was actually placed on your system.
After installing Navigator 3.0 in the C:\Program Files\Netscape\Navigator directory, examine the contents of that directory under Windows 95. Under the .\Program\javadirectory, you will find a set of directories and files that look suspiciously like the JDK installation. This is how Web browsers are able to run Java applets. They basically install a customized version of the JDK in their runtime directories so that they can load Java applets and their own set of customized Java classes. This results in somewhat of a Catch-22 situation. Because Netscape, for instance, provides a customized version of the JDK, subtle changes in the underlying code could result in an applet running differently in the Navigator browser than, say, the Internet Explorer browser. Be sure to test completed Java applets in a wide variety of browsers on a variety of operating systems, if possible, in order to ensure that the applet you will be displaying to the world does what you think it should.
No comments:
Post a Comment