1)Several ports (8080, 8009) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
(端口被占用,发现是之前在控制台 startup.sh 启动了 tomcat, )处理:shutdown.sh 然后在 eclipse 启动 tomcat
2)用Eclipse新建 一个web项目没有自动生成web.xml用Eclipse新建一个web项目没有自动生成web.xml
https://jingyan.baidu.com/article/90808022c495d9fd91c80f15.html
3)Eclipse导入项目:No projects are found to import
https://yq.aliyun.com/articles/37881
4)出现selection does not contain a main type问题的解决办法
1、是因为.java文件不在项目的src路径内,也就是说源代码未被eclipse编译,字节码不存在无法运行了在项目名上右键 -> Builder Path -> Configure Build Path -> 选择Source面板 再点Add Folder, 把源代码所在的包路径的上层目录加进来,而且如果你是把两个类写在一个文件里的话,你在右键选择Run As JavaAppication 的时候,要把光标至于包括main方法的类上
2、最快捷的解决办法是,打开带有main函数的类,ctrl +A (全选)---> ctrl +X(剪切)-----> ctrl+S(保存)--->关闭---->再打开--->ctrl +C (粘贴) ---->OK;一句话就是粘出去 关闭 再粘进来