Computer Science @ PENN

java 1.5 api | java 1.4.2 api | slashdot | webmail | wikipedia | directories | portal | van pelt library | engineering library
computer graphics & game dev (SIGGRAPH) | dining philosophers (DP) | science & tech wing (STWING) | women in cs (WICS)
CETS Answers |

How to Install DrJava (and Java if necessary)

NOTE: DrJava should be available in all the dorm computer labs. If not, let us know by posting a message on the bulletin board.

Note also: These directions aim to get Java 1.5 and the DrJava's "Current Stable Release" working .


  • The eventual setup will be JDK 1.5.0 r0 and DrJava's Current Stable Release for Windows XP.
    Windows Vista will also need JRE 1.6.0.
  • Instructions for Windows Vista also applies to anything else above (namely Windows 7)
  • Go to Add/Remove programs. If you have Java 1.5.0 r5 (the latest) installed, you'll definitely need to delete it. You may well also want to delete any 1.4.2 Java stuff, although DrJava seems not to get confused by it.
  • Download and install the JDK (not the JRE)1.5.0 from Sun's archives.
    For Windows Vista, also download JRE (not JDK) 1.6.0 update 4.
  • Download the DrJava "Current Stable Release" Windows application from DrJava.
  • You may need to specify the location of the tools.jar file the first time you run DrJava. Assuming you have the 1.5 JDK installed correctly, tools.jar should be in C:\Program Files\Java\jdk1.5.0\lib.

MacOS X (Tiger 10.4, Leopard 10.5)

  • Download the DrJava "Current Stable Release" MacOS X app from and put the application in your Applications folder.
  • Run DrJava. Look under the compiler tab at the bottom right and check the version. If it says something like "javac 1.5.x" or "JDK 5.0.x" or (where x is any number) you're done!
  • Depending on the age of your MAC, you may have Java 5 or 6 ("JDK 6.0_x"), either of which is fine.
    • If java 1.5.x isn't available:
      1. Look for the Java Preferences app on your Mac in Applications > Utilities > Java > J2SE 5.0 (cmd-shift-U opens Utilities).
      2. If the J2SE 5.0 directory is missing, Download the latest Java 1.5.0 from Apple and install it.
      3. Open the Java Preferences application in J2SE 5.0. In the "Java Application Runtime Settings Pane" drag J2SE 5.0 to the top of the list. Click "Save" and close at your leisure.
  • Optional: If you use Safari and Java 1.5 applets are not displaying:
    • Follow the directions above to ensure that your Mac has Java 1.5
    • Add this action to step 3: Select J2SE 5.0 from the drop-down menu under "Java Applet Runtime Settings".
  • Optional: If you want to compile from the command line (which is not needed for the intro courses):
    • The Java 1.5 java and javac command-line tools may not be immediately accessible; they are in /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands (/usr/bin/java is a link).
    • Open Terminal, which is in Applications, in Utilities (cmd-shift-U), which brings you the Unix command line.
    • To check if you need to change anything, type java -verison and hit return. If the output is something like java version "1.5.0_VV", you're all set. Otherwise, keep going.
    • Change your working directory to the Java Versions directory: type cd /System/Library/Frameworks/JavaVM.framework/Versions at the prompt and hit return.
    • Remove the link CurrentJDK which points to 1.4.2 and replace it with a link pointing to 1.5.0 with these two commands (you will need an administrator password): sudo rm CurrentJDK and then sudo ln -s 1.5.0 CurrentJDK. (Close Terminal.)


  • Download and install the latest JDK from Sun, from the download page (either the self-extracting rpm, or just the self-extracting file, after accpeting the license agreement).
  • Optional (may or may not be required for DrJava): Change the commands java and javac to point to Java 1.5.0 - under Fedora Core 3, java ended up in /usr/java/jdk1.5.0_01/bin/java and javacin the same directory, so the relevant commands were sudo rm /usr/bin/java and sudo rm /usr/bin/javac , then cd /usr/bin sudo ln -s /usr/java/jdk1.5.0_01/bin/java and finally sudo ln -s /usr/java/jdk1.5.0_01/bin/javac.
  • Download the DrJava "Current Stable Release" jar from DrJava and run it using (replacing the X's with the appropriate date information): java -jar drjava-stable-XXXXXXXX-XXXX.jar (from the directory you downloaded it to).
  • Optional: If you're using FireFox or another Mozilla browser, you can add the Java plugin like this: cd /usr/lib/mozilla/plugins and then sudo ln -s /usr/java/jre1.5.0_02/plugin/i386/ns7/ — but don't count on that to work on every system.

More Help

If these instructions don't work for you, or you otherwise want more help, see the "DrJava Installation" section of the CSE1xx Forums.