CS111 Computing At Home


Warning: this page has not yet been updated for Fall'06

This page is meant for informational purposes only. The CS111 instructors and the Computer Science Department do NOT support installation and use of programs for personal computer use. We are not able to answer questions about installing and running programs on personal computers. The information offered below should be used at your own risk!


Table of Contents

DrJava

Macintosh OS X

PCs running Windows


DrJava


Topic: How can I run DrJava on my own computer?

DrJava is free to download and use under the terms of the GNU General Public License as published by the Free Software Foundation. It is available for both Macintosh OS X and PCs running Windows.


Macintosh OS X


Topic: Running Java applets on Netscape Navigator and Internet Explorer

If you want to run a Java applet, you can open an HTML file which specifies an applet in Netscape Navigator or Microsoft Explorer or Apple Safari. The applet should run just fine in the browser. However, there may be a problem if you want to modify the Java applet and re-run it with your browser. Mac OS X causes these browsers to cache (store) .class files. This means that if you run an applet through one of these browsers, and then you change the applet (edit the .java files and recompile them), the browser will still run the old version of the applet (the cached version). To clear these old versions from the cache, you have to quit out of the browser. This is too much trouble for most of us. We would like new files to be loaded into the browser when we click on the "refresh" or "reload" button. To achieve this, follow the steps below:


Topic: Which version of Java should I be using?

Macintosh OS X has two versions of Java installed: Java 1.4.1 and Java 1.3.1. By default, Mac OS X uses Java 1.4.1. But this version may be a bit buggy. So we recommend using Java 1.3.1. Below are directions for changing to use Java 1.3.1. Note: in order to change versions, you will need administrator privileges (which you should have on any machine you own), and as a result, you may be asked to enter your password at various stages of the process.

To confirm that you are now using Java 1.3.1, simply type "java -version" in the Terminal window. If you see the response "Java version 1.3.1" then you have successfully changed versions.

Details:
If you're interested in more detail about what really happened when you typed the above lines... The first line you typed "cd /System/..." changed the directory (folder) from your home directory (folder) to the directory (folder) which contains the different versions of Java. Inside this directory is a link called "CurrentJDK". This link points to the default version of Java (which is initially version 1.4.1). The second line you typed "sudo rm CurrentJDK" removed this link. The third line you typed "sudo ln -s ..." created a new link to version 1.3.1, making it the default version.


Topic: Using Safari to run Java applets

Safari has a similar problem to the one we faced earlier... it has a plug-in called Cocoa which uses Java version 1.4.1 which may be buggy. Safari also has plug-ins for Java 1.3.1. So lets disable the plug-in for Java 1.4.1 so our Java applets will run smoothly.

If you want to verify that you are now successfully using only 1.3.1 Java plug-ins with Safari, you can do the following. Open up Safari. Now go to the "Help" menu at the top of the screen and select "Installed Plug-Ins". You should NOT see the lines "Java Plug-in for Cocoa" and "Java 1.4.1 Plug-in (sun.plugin.appletviewer) - from file JavaPluginCocoa.bundle". If you see these lines then you did not successfully remove the plug-in. If these lines are absent, then you are good to go!


PCs running Windows


Topic: Running Java applets on Netscape Navigator and Microsoft Explorer

If you want to run a Java applet, you can open an HTML file which specifies an applet in Netscape Navigator or Microsoft Explorer. The applet should run just fine in the browser.


Topic: Which version of Java should I be using?

We recommend that you run the Java Runtime Environment ("JRE") J2SE version 1.4 from Sun. It is likely that your machine is already running this. You can check by typing in "java -version" into a console window. If you are not running this, you can download and install it from Sun.

You also need to be able to compile Java programs. We recommend downloading and installing the "SDK" J2SE version 1.4.2_01 from Sun.