启动tomcat 报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

 

[root@localhost META-INF]# systemctl start tomcat
Job for tomcat.service failed because the control process exited with error code. See "systemctl status tomcat.service" and "journalctl -xe" for details.
[root@localhost META-INF]# systemctl status tomcat.service
● tomcat.service - Tomcat
   Loaded: loaded (/usr/lib/systemd/system/tomcat.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2019-02-19 12:12:06 EST; 11s ago
  Process: 7551 ExecStart=/usr/local/tomcat/bin/startup.sh (code=exited, status=1/FAILURE)

Feb 19 12:12:06 localhost.localdomain systemd[1]: Starting Tomcat...
Feb 19 12:12:06 localhost.localdomain startup.sh[7551]: Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
Feb 19 12:12:06 localhost.localdomain startup.sh[7551]: At least one of these environment variable is needed to run this program
Feb 19 12:12:06 localhost.localdomain systemd[1]: tomcat.service: control process exited, code=exited status=1
Feb 19 12:12:06 localhost.localdomain systemd[1]: Failed to start Tomcat.
Feb 19 12:12:06 localhost.localdomain systemd[1]: Unit tomcat.service entered failed state.
Feb 19 12:12:06 localhost.localdomain systemd[1]: tomcat.service failed.

 

打开tomcat的bin目录下的setclasspath.sh,手动加入两个环境变量

 

 

参考:

https://blog.csdn.net/to_baidu/article/details/52848620

https://www.cnblogs.com/purplestone/p/3964207.html

转载于:https://www.cnblogs.com/sea-stream/p/10404346.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值