一、在Eclipse中启动Tomcat服务器的时候,可能会出现端口被占用的情况,此时便无法启动Tomcat服务器。解决方法就是要关闭占用端口的进程。
Several ports (8005, 8080, 8009) required by Tomcat v8.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
1、开始->运行->cmd,或者是window+R组合键,调出命令窗口
2、输入命令:netstat -ano,列出所有端口的情况。在列表中我们观察被占用的端口8080,并记下此时的PID,即1204.
3、输入tasklist|findstr “1204”,查看是哪个进程或者程序占用了8080端口,结果是:javaw.exe
4、打开任务管理器,找到这个进程,并结束此进程
二、使用Eclipse编写jsp页面时,出现提示
Multiple annotations found at this line:
- The superclass "javax.servlet.http.HttpServlet" was not found
- on the Java Build Path
1、右击此项目,在出现的菜单栏中选择Properties,弹出一个对话框
2、在左侧导航栏中选择Java Build Path
3.在对话框的右侧,选择Add Library选项
4.选择Server Runtime后,单击Next
5、单击Apache Tomcat v8.0后,点击finish
6、最后,点击OK完成配置,此时,提示消失,运行结果
三、修改Eclipse的charset为UTF-8,参考此处
1、编辑Eclipse的安装文件夹中的eclipse.ini文件
2、在文件中添加一行,Dfile.encoding=utf-8,保存配置