Error message on running the java code from Eclipse
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi,
I installed Eclipse newly on E: drive at my computer and the workspace location is F:\java-exp. the jdk is located at the following path F:\Program Files\Java\jdk1.6.0_02. I am trying to run a new program using Eclipse and am getting the following error "selection does not contain a main type". even .class file is not created in the output folder. can you please help me on this as I am sure that this must be some setup/configuration issue. Also paradon me if I am using a wrong forum for posting this question.
Regards,
I installed Eclipse newly on E: drive at my computer and the workspace location is F:\java-exp. the jdk is located at the following path F:\Program Files\Java\jdk1.6.0_02. I am trying to run a new program using Eclipse and am getting the following error "selection does not contain a main type". even .class file is not created in the output folder. can you please help me on this as I am sure that this must be some setup/configuration issue. Also paradon me if I am using a wrong forum for posting this question.
Regards,
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
It looks like what ever class file you are trying to run does not have a
method. It might be that your pressing the Run button when you have the wrong method selected, have no main(...) method, or have the main(...) method declared incorrectly.
method. It might be that your pressing the Run button when you have the wrong method selected, have no main(...) method, or have the main(...) method declared incorrectly.
Steve
nitinram agarwal
Ranch Hand
Posts: 102
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
its a very simple program
public class Hello {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello World");
}
}
public class Hello {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello World");
}
}
nitinram agarwal
Ranch Hand
Posts: 102
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
please can someone help on this
posted 16 years ago
There is nothing wrong with the class -- likely an eclipse config error. Moving topic to IDE forum.
Henry
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
There is nothing wrong with the class -- likely an eclipse config error. Moving topic to IDE forum.
Henry
nitinram agarwal
Ranch Hand
Posts: 102
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
can anyone look at it and advice please?
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Did you create a Java Project or a simple Project?
Is the Hello.java file in a directory identified by Eclipse as a "source directory"? If not, Eclipse will neither compile not run it.
Did you turn off automatic build? Can you build manually?
If you created a Java Project and the Hello.java file is in a source directory, then try adding a package declaration to the class and see if that helps.
Is the Hello.java file in a directory identified by Eclipse as a "source directory"? If not, Eclipse will neither compile not run it.
Did you turn off automatic build? Can you build manually?
If you created a Java Project and the Hello.java file is in a source directory, then try adding a package declaration to the class and see if that helps.
| Honk if you love justice! And honk twice for tiny ads! The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |








