Running Java Applets

The Internet holds a wealth of resources for adult learners. There are literally millions of web sites providing educational information on almost any topic you might imagine. In the areas of math and science in particular there are countless sites that provide interactive learning resources. You've probably used some of these resources. Typically a window appears in your browser and you interact with the program running in that window to learn more about the topic of interest.

Unfortunately it is also quite common to find or be directed to a resource that that doesn't seem to work on your computer. In this Bit Literate Guide we will provide an overview of interactive web learning technologies, and we'll tell you things to try when they don't work.

Let's start by looking at an example. The Physics 2000 web site from the University of Colorado explains how discoveries made by physicists have improved our everyday lives. The one we'll look at describes and explains how CAT scans work.

Click here to go to the CAT scan tutorial on Physics 2000. (opens in a new window)

After you've read through it, and tried the simulations, close the window to come back to this page.

The developers of this resource provided a complete learning experience. They've taken the topic of CAT scans and written a clear description of how it works. And they embedded interactive applets in the pages to help you visualize the ideas presented in the text. These applets are very simple and they provide instructions telling you exactly what you need to do. This is a very well designed learning resource.

Many interactive resources like this one make use of "Java Applets". Applets are a special type of program written in the Java programming language.  The thing that makes applets special is that the applet technology was created specifically for the creation of programs to be embedded in a web page. When you open a web page containing an applet, the applet is transferred from the server to your computer, and the browser uses the Java engine on your computer to run the program. But that's where the problem comes in. Sometimes the java engine on your computer doesn't cooperate.

There are few potential problems, and we'll explain, but first let's talk about security. If this is the first time you've thought about what happens when an applet loads, you might be worried. After all, if you go to a web page and a program automatically loads and runs on your computer couldn't that program do harm? What if the program contains a virus? Happily, this issue was considered before the applet technology was created. So the kinds of things that an applet can do are strictly limited. For example, applets do not have the ability to read or write files to your computer's hard disk. The Java commands that a programmer would normally use to open or load files are not allowed in applets. Similar restrictions apply to other types of commands that a program could potentially use for malicious purposes. So are applets perfectly safe? Unfortunately there are no perfectly safe technologies. Clever malicious people find ways to get around security systems all the time. But the security protections designed into the applet technology have proven to be robust over time and there have been very few instances of applets containing viruses or other malicious code.

So security was the first potential problem. A second problem, and one that comes into play far more often is that an applet just won't run. There are numerous reasons why this might occur but generally it comes down to an incompatibility with the java engine installed on your computer. As mentioned before, when an applet runs your web browser uses the java runtime environment (JRE) installed on your computer to actually execute the applet code.

But the Java runtime environment is not part of Windows itself. It's something you have to add on, and there are different versions in common use. For most users most of the time this situation is invisible, you have a JRE on your computer and it works just fine. But sometimes an applet requires the use of a specific version of the JRE and you have the wrong one.

Internet Explorer sometimes has this problem. Older versions of IE (before 2005) came with a copy of the JRE created by Microsoft. But Microsoft has been in a long running feud with Sun Computers (the company that invented Java) and can no longer distribute the Java engine. So users of newer versions of IE must install a JRE themselves.

So, the second potential problem with applets is that you might have an incompatible version of the JRE on your computer. If you think this is causing problems on your computer you can fix it by going to the Sun Java web site and downloading and installing the latest version of the JRE. This is painless but be sure you get the "Java JRE" and not something that says "SDK". The SDK is the software developers kit and it contains lots of extra programs and code that programmers need to create java programs. It won't do you any harm, but it much larger and it is harder to install. Installing the latest version of the JRE will fix many problems with Java applets.

 
 
 

Resource Information:

Running Java Applets

Level: Intermediate

Summary: Java Applets are commonly used to embed interactive objects in a web page. Many educational applets are Java applets. But running applets can sometimes be problematic. This Bit Literate Guide explains how applets work and provides troubleshooting information.

 

 

© 2006, Empire State College