Issue
Whenever I try to launch my code, Eclipse gives me the error "selection does not contain a main type" This is my code:
public class main {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Here is the project tree:
for a comment:
Solution
The file is excluded from the run types in Eclipse as it exists outside a source folder. Create a new source folder src/main/java
and move the file there.
Here are the basic project source folders for Eclipse:
src/main/java
- Java source filessrc/main/resources
- Project resources, e.g. images, property filessrc/test/java
- Unit test Java source filessrc/test/resources
- Test resource files
Answered By - Reimeus