Ubuntu tomcat7 设置 JDK 路径

Setting up jdk path (JAVA_HOME) for Tomcat7 in ubuntu

If you are a newbie like me, you might have the same problem as me when you wanted to start the tomcat7 on ubuntu:
  • no JDK found - please set JAVA_HOME
Make sure the JAVA_HOME is set properly: if issuing " echo $JAVA_HOME" does not show any paths, you should add the following lines to your   ~./bashrc  (if you want to set it locally ) or if you want to set it globally you should add these to /etc/bash.bashrc  :


#Java Environment Variable
JAVA_HOME=/usr/lib/jvm/jdk1.7.0/
export JAVA_HOME
JRE_HOME=/usr/lib/jvm/jdk1.7.0/jre
export JRE_HOME
PATH=$PATH:$JAVA_HOME:$JRE_HOME
export PATH

Now, normally, after reopening the terminal and issuing " sudo service tomcat7 start" should start the tomcat. But if you see the error above again:

  • no JDK found - please set JAVA_HOME


Just to this:  "gksudo gedit /etc/default/tomcat7"  and uncomment the line that sets the JAVA_HOME variable:


Now run the tomcat. This should do the trick.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值