Java项目启动时候报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 解决办法

今天在发布Java项目的时候又遇到   
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 
At least one of these environment variable is needed to run this program
 这种情况了,
解决办法:
首先查看环境变量:
vim  /etc/profile
找到JAVA_HOME
把路径记录下
 
编辑文件
/usr/local/tomcat/bin/catalina.sh  (有可能你的路径和我的不一样,按照自己的路径来修改)
添加到文件中的第二行

 

posted @ 2018-07-18 09:49  大象无形01  阅读(34724)  评论(1编辑  收藏  举报