aspose file tools*
The moose likes Beginning Java and the fly likes Editor does not contain a main type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Editor does not contain a main type" Watch "Editor does not contain a main type" New topic
Author

Editor does not contain a main type

Steve De Costa
Ranch Hand

Joined: Jun 04, 2007
Posts: 33
I know this question has been answered before but I tried applying those methods and it didn't work for me. I have one Project and I tried importing the Jgrapht Library in it. When I try to compile any of the files in the imported packages, I get the "Editor Does not contain a main type".


I have no idea how to fix it. In the "default.src" package of my project, I tried to include import the package such as




However, it doesn't recognize the files are there? Any suggesstions please?

Thanks in advance for your help.



[Thumbnail for MainMissing.JPG]

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Do you have a main method in there ? If yes, make sure it's well declared (public static void main(String[] args))


[My Blog]
All roads lead to JavaRanch
Vishal Kashyap
Ranch Hand

Joined: Aug 07, 2010
Posts: 73

I think,
please try to install JDK again and the work for your program, if your program contains main method then it should not rise ERROR like this.


MCSA 2003 | Preparing For OCPJP/SCJP6
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
Beware: screenshots can be difficult to read.

If you have downloaded a library, you would not expect it to be executable, so there will be no class with a main() method.

Which IDE are you using? It looks like Eclipse to me. There is no need to instruct Eclipse to compile anything; you are probably clicking a "run" button. Find a class with a main method which you can do by going through the jgrapht.org javadoc pages; those classes with "Demo" in their name would probably do. Right-click that class in the package explorer, and then "run as" . . . "Java application".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Editor does not contain a main type