#297 Static Undefined Class Error

Emily Hines

I teach APCS and a Java Introduction class and would like to use DrJava as our IDE. I installed it on my mac over the summer and loved it. Now I am trying to install it on my desktops at school and keep getting an undefined class error when trying to run a simple program.

public class HelloWorld
public static void main(String[] args)
System.out.println("Hello World!");

The file is named HelloWorld.java, so it is not a problem with the filename or case-sensitivity. I am using the run button in DrJava and have also tried using the run command in the interactions pane. The error message is: Static Error: Undefined class 'HelloWorld'. These computers have Java 2 Runtime Environment, Java DB, Java 6 Update 37, and Java SE Development Kit 6 Update 37 on them. My System Properties are:

System Properties:
DrJava Version drjava-20120818-r5686
DrJava Build Time 20120818-0422

drjava.debug.port = 4604
java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = C:\Program Files\Java\jre6\bin
java.vm.version = 20.12-b01
java.vm.vendor = Sun Microsystems Inc.
java.vendor.url = http://java.sun.com/
path.separator = ;
java.vm.name = Java HotSpot(TM) Client VM
file.encoding.pkg = sun.io
sun.java.launcher = SUN_STANDARD
user.country = US
sun.os.patch.level = Service Pack 3
java.vm.specification.name = Java Virtual Machine Specification
user.dir = <anonymized user.dir>
java.runtime.version = 1.6.0_37-b06
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs = C:\Program Files\Java\jre6\lib\endorsed
os.arch = x86
java.io.tmpdir = C:\DOCUME~1\&lt;anonymized user.name>\LOCALS~1\Temp\ line.separator = "\u000d\u000a"
java.vm.specification.vendor = Sun Microsystems Inc.
user.variant =
os.name = Windows XP
sun.jnu.encoding = Cp1252
java.library.path = C:\Program Files\Java\jre6\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jre6\bin;.
java.specification.name = Java Platform API Specification
java.class.version = 50.0
sun.management.compiler = HotSpot Client Compiler
os.version = 5.1
user.home = <anonymized user.home>
user.timezone = America/Chicago
java.awt.printerjob = sun.awt.windows.WPrinterJob
file.encoding = Cp1252
java.specification.version = 1.6
java.class.path = <anonymized user.dir>\drjava-stable-20120818-r5686.exe
user.name = <anonymized user.name>
java.vm.specification.version = 1.0
sun.java.command = <anonymized user.dir>\drjava-stable-20120818-r5686.exe
java.home = C:\Program Files\Java\jre6
sun.arch.data.model = 32
user.language = en
java.specification.vendor = Sun Microsystems Inc.
awt.toolkit = sun.awt.windows.WToolkit
java.vm.info = mixed mode, sharing
java.version = 1.6.0_37
java.ext.dirs = C:\Program Files\Java\jre6\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
sun.boot.class.path = C:\Program Files\Java\jre6\lib\resources.jar;C:\Program Files\Java\jre6\lib\rt.jar;C:\Program Files\Java\jre6\lib\sunrsasign.jar;C:\Program Files\Java\jre6\lib\jsse.jar;C:\Program Files\Java\jre6\lib\jce.jar;C:\Program Files\Java\jre6\lib\charsets.jar;C:\Program Files\Java\jre6\lib\modules\jdk.boot.jar;C:\Program Files\Java\jre6\classes
java.vendor = Sun Microsystems Inc.
file.separator = \ java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
java.rmi.server.hostname =
sun.desktop = windows
sun.cpu.isalist = pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

DrJava configuration file
In resource bundle edu.rice.cs.drjava.config.options:

In shadowed configuration:
key.delete.next = [shift DELETE]
key.delete.previous = [shift BACK_SPACE]
recent.files = [\\\\Cms-app\\teachers\\&lt;anonymized user.name>\\Desktop\\JAVACode\\Asciii.java,\\\\Cms-app\\teachers\\&lt;anonymized user.name>\\Desktop\\JAVACode\\HelloWorld.java,\\\\Cms-app\\teachers\\&lt;anonymized user.name>\\Desktop\\JAVACode\\MyFirstProgram.java]
window.width = 1127
window.x = 81
window.y = 207
last.dir = \\\\Cms-app\\teachers\\&lt;anonymized user.name>\\Desktop\\JAVACode\\HelloWorld.java
last.interactions.dir = \\\\Cms-app\\teachers\\&lt;anonymized user.name>\\Desktop\\JAVACode
tabbedpanes.state = 640 512 700 400
new.version.notification.last = 1351516960049
file.ext.registration = always

Used memory: about 33.12 megabytes
Free memory: about 11.98 megabytes
Total memory: about 45.10 megabytes
Total memory can expand to: about 247.50 megabytes

Number of processors/cores: 2

Compiler Discovery Log:

Can you tell me how to fix this problem?


  • Mathias Ricken
    Mathias Ricken

    Hi Emily,

    The only thing that I can think of is that maybe DrJava gets confused with the folder in which your source file is located. Could you try putting the HelloWorld.java file in a folder that starts with a drive letter, such as C:\ ?

    If DrJava is able to compile the file (by pressing the Compile button) and then run the class, then this may be a recurrence of an old bug. I'm sorry for the inconvenience.