This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes eclipse editor does not contain main type Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "eclipse editor does not contain main type" Watch "eclipse editor does not contain main type" New topic
Author

eclipse editor does not contain main type

shihab K Bava
Greenhorn

Joined: Oct 03, 2004
Posts: 12

Dear friends,

When I tried to run the above vlas from eclipse I got an error "editor does not contain main type". But when copy the class to another package it works fine. Any clues?

THe main point is I am trying to run some demo applications. All libraries and jar files are there in my systesm and path and classpath variable are correct. But when I am tryign to run a class which have main,, it gives the same error. So that I created a test class (above class) and tried to run. When that class in the package demos.texture it gives error. But when the test class copied to another package it works fine. Any one can help?

Thanks and Regards
Shihab
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You need to select/open the class file in the editor and bring it to front before to run it. If you tabbed/switched to another class file in the editor, then this one will be runt. If this one doesn't have a main method, you will get this error.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
Sp Sandhu
Greenhorn

Joined: Jul 12, 2010
Posts: 1
also i tried a SWT demo code that earlier gave this error with this main inialization>
public static void main (String [] args) {

notice the space b/w String & []

so i replaced with

public static void main (String[] args) {

and it worked
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: eclipse editor does not contain main type
 
Similar Threads
eclipse - active editor does not contain a main type
java.lang.NoClassDefFoundError: jdk1/5/0_04
AbstractMethod Error
Error: The active editor does not contain a main type
classpath Ques