When a program with a main method that is not static is run, DrJava prints a confusing error message when the "run" command is used. It works with the "java" command.
Welcome to DrJava. Working directory is D:\Documents\Dev\Java
> run Lab
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:271)
> java Lab
Static Error: No method in static Lab has name 'main'
>
For an example program, see http://stackoverflow.com/questions/7911004/nullpointerexcetion-native-method-accessor-hashing-words-issue
Hello,
I was able to replicate this issue by taking a working program and removing "static" from the main method. The errors listed do not give much insight into what in the code causes the errors.