Search code examples
javaeclipsejakarta-eeeclipse-juno

Eclipse Juno for Java EE doesn't have "Run as Java Application" on one Java SE class only


I have what seems to be a weird problem with Eclipse (Juno) for Java EE Developers. One particular class that was created as Java SE GUI (extends JFrame) does not show "Run as Java Application" option.

So far I have tried the following to no avail:

  • created another project and copied my java source file there
  • created a new java class and copy-pasted my code into it

I also verified that I was in Java (not Java EE) view and that other java classes from older projects still have "Run as Java Application" option.

Any ideas how to troubleshoot this situation?

Would it help if I post my code (it's rather small) here?

UPDATE:

That what actually was in the code:

public void  main() {

After I corrected it, the problem disappeared.


Solution

  • The class has to have a valid main method:

    public static void main (String[] args){}
    
    public static void main (String... args){}