我无法在 centos 浏览器中连接 tomcat,但它从终端启动

我无法在 centos 浏览器中连接 tomcat,但它从终端启动

当我输入时./startup.sh我得到:

Using CATALINA_BASE:   /home/ashok/apache-tomcat-7.0.56
Using CATALINA_HOME:   /home/ashok/apache-tomcat-7.0.56
Using CATALINA_TMPDIR: /home/ashok/apache-tomcat-7.0.56/temp
Using JRE_HOME:        /usr/java/jdk1.7.0_05/bin/java
Using CLASSPATH:       /home/ashok/apache-tomcat-7.0.56/bin/bootstrap.jar:/home/ashok/apache-tomcat-7.0.56/bin/tomcat-juli.jar
/home/ashok/apache-tomcat-7.0.56/bin/catalina.sh: line 319: /usr/java/jdk1.7.0_05/bin/java/bin/java: No such file or directory
/home/ashok/apache-tomcat-7.0.56/bin/catalina.sh: line 319: exec: /usr/java/jdk1.7.0_05/bin/java/bin/java: cannot execute: No such file or directory

答案1

说的很清楚。尝试理解错误消息。这JRE_HOME应该 /usr/java/jdk1.7.0_05/不是/usr/java/jdk1.7.0_05/bin/java

答案2

请添加到您的/etc/profile:

export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")

登录并注销才能生效。

这样做的好处是你不必每次更新 Java 时都更新它。

相关内容