Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
每当我尝试启动我的代码时,Eclipse 都会给我错误“选择不包含主要类型”这是我的代码:
public class main { /** * @param args */ public static void main(String[] args) { System.out.println("Hello World!"); } }
这是项目树:
评论:
该文件从 Eclipse 的运行类型中排除,因为它存在于源文件夹之外。创建一个新的源文件夹src/main/java并将文件移动到那里。
src/main/java
以下是 Eclipse 的基本项目源文件夹:
src/main/resources
src/test/java
src/test/resources