打Javaweb项目包上Tomcat
(参考博客:https://www.cnblogs.com/BraveApple/p/9578092.html)
1.项目打war包,官网下载tomcat
2.war包导入到tomcat的webapp路径
3.启动tomcat的bin目录下面startup.sh脚本
4.如果需要关闭,则执行shutdown.sh
打包java web项目的步骤:
(参考博客:https://www.cnblogs.com/BraveApple/p/9578092.html)
1.选中要打包的项目右击选择【export】,搜索war,选择【war file】之后next.
2.在web project输入war包的名称,在destinations里面输入生成war包的存储位置,然后点击finish.
如果报下面异常:
(参考博客:https://www.cnblogs.com/samwang88/p/6655687.html)
Cannot find ./catalina.sh
The file is absent or does not have execute permission
This file is needed to run this program
解决方法:
在tomcat 的bin目录下 执行这条命令
chmod +x *.sh
再次执行 sh catalina.sh通过,
然后用sh startup.sh启动成功