Official Documentation

The questions below are ones that Edhesive's support team commonly encounters that are addressed in DrJava's official documentation (plus some additional info our team has found to be helpful). If you wish to search this documentation yourself, the links are as below. You can also find more info on using the more advanced features of DrJava in this documentation.

If you wish to reach out to the makers of DrJava directly to provide feedback or report a bug, click here.

FAQs

If the questions below don't resolve your issue, please reach out to our TA team in the AP CS A Teacher Forum to troubleshoot further.

Why won't DrJava start on Windows?

If you get an error message from Windows when running DrJava (before the DrJava splash screen appears), you probably either do not have Java installed or it is not configured correctly. First, ensure that you have installed the Java Software Developer Kit (SDK) and not just the Java Runtime Environment (JRE).

If you still cannot run DrJava, try downloading the *.jar file rather than the "Windows App" from the DrJava home page and double clicking on it. If Windows asks you which program to use to open the file, select javaw.exe  (which should be located in C:\Program Files\Java\j2re...\bin\javaw.exe or a similar folder).

I'm being prompted to locate the tools.jar file. What is that?

First, make sure you installed the JDK and not the JRE. If you did install the JDK, keep reading. If you installed the JRE, use the instructions here to download and install the JDK instead.

The tools.jar  file is part of the JDK and contains the libraries that DrJava needs in order to run the compiler, debugger, and other language tools. DrJava looks in a number of typical locations to find the file but, if it can't find it, you may be prompted to point to it. The typical error message for this will read as No Compiler Available  or:

Compiler not found. The file you chose did not appear to contain the compiler. Would you like to pick again? The compiler is generally located in 'tools.jar', in 'lib' subdirectory under your JDK installation director. (If you say 'No', DrJava will be unable to compile programs.)

When this error shows, you will need to set DrJava's Preferences to the correct path for tools.jar . To do so, follow these menu items: "Edit" > "Preferences" > "Resource Locations" > "Tools.jar Location". Then, type in or click the dots to browse for the correct location. If you followed the default options during the JDK installation process, the usual locations are:

  • For Windows machines:
C:\Program Files\Java\jdk[insert version number here].jdk\lib\tools.jar
  • For Macs
Users\[insert user's name]\Library\Java\JavaVirtualMachines\jdk[insert version number here].jdk\Contents\Home\lib\tools.jar

If the file is not in this location, you can also use a desktop tool to search for this file on your computer.

I'm unable to compile. I get a "cannot read zip file entry" error. What should I do?

Sometimes, when DrJava is used with the JDK 6.0, update 4 or newer, DrJava will report the following error when you try to compile:

Error: error: error reading D:\path\drjava-beta-20090505-r4932.exe; cannot read zip file entry

This error is due to a bug in JDK 1.6.0_04+. DrJava *.exe  file releases prior to 20080415 are affected. Windows users experiencing this error should upgrade to a more recent DrJava version, which includes a workaround.

If this happens to you, please use the *.jar  file instead of the *.exe  file. This will avoid the problem.

Why do I get a ZipException when trying to run DrJava?

If you get the following error message when running DrJava for the first time, your copy of DrJava is likely corrupted. Try deleting DrJava and downloading it again. Make sure that you are downloading the files indicated from the homepage and not the downloads page as instructed here.

Exception in thread "main" java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.(ZipFile.java:112)
    at java.util.jar.JarFile.(JarFile.java:117)
    at java.util.jar.JarFile.(JarFile.java:55)

I'm getting an error that the current document is out of sync with the Interactions Pane. How do I fix this?

The following error can be caused by a couple of different things:

ERROR: Current document is out of sync with the Interactions Pane and should be recompiled!

For example, this can happen if there is a problem with the build path of the file (sometimes when a file is copied or moved, the default settings that help DrJava access all the necessary directories to run the file are messed with) or there is a problem with settings.

To resolve this error, there are two things you should check:

First things first - are your settings correct?
The easiest way to solve this problem is to hit reset  then compile  then run . This will solve the issue if you for some reason accidentally changed some runtime or compile settings by copying and pasting files or deleting some default preferences. You can see how to do this in the GIF below.

Next, are you using the correct Java version?
In the menu bar for DrJava, navigate to Edit  > Preferences  > Resource Locations  > Tools.jar Location  to check the version listed is (based on your machine):

  • Windows: C:\Program Files\Java\jdk1.8.0 
  • Mac: /Users/[user's name goes here]/Library/Application Support/Java/Java 1.8.221.11/Java 8 Update 221.app 

If you aren’t, try typing this in to check to see that you have it downloaded and try to run the program again by saving and hitting compile  then run . If you don’t have this downloaded, see the DrJava installation instructions on how to download the right version (JDK 8).

Did this answer your question?