#921 Confusing Error Message when main Method not static

open
nobody
5
2011-10-28
2011-10-28
No

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

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks