linux下找到真正的JDK路径,从而解决默认编译安装java后不知道jdk路径,以至于无法启动Tomcat的问题。 输入:
[root@cheng java]# ls -lrt /usr/bin/javalrwxrwxrwx 1 root root 22 Feb 9 18:22 /usr/bin/java -> /etc/alternatives/java[root@cheng java]# cd /etc/alternatives/java发现:
lrwxrwxrwx 1 root root 39 Feb 9 18:22 java -> /usr/lib/jvm/jre-1.7.0-openjdk/bin/javalrwxrwxrwx 1 root root 30 Feb 9 18:22 jre -> /usr/lib/jvm/jre-1.7.0-openjdklrwxrwxrwx 1 root root 30 Feb 9 18:22 jre_1.7.0 -> /usr/lib/jvm/jre-1.7.0-openjdk真实目录在这里:
[root@cheng bin]# cd /usr/lib/jvm/jre-1.7.0-openjdk[root@cheng jre-1.7.0-openjdk]# lltotal 8drwxr-xr-x 2 root root 4096 Feb 9 18:22 bindrwxr-xr-x 10 root root 4096 Feb 9 18:22 lib那么在 /etc/PRofile里需要这样配置java环境
export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk/export CALSSPATH=$JAVA_HOME/lib/*.*export PATH=$PATH:$JAVA_HOME/binexport TOMCAT_HOME=/opt/tomcat7export CATALINA_HOME=/opt/tomcat7这样就能正常启动Tomcat了,而不是提示启动成功,实则没有启动。
新闻热点
疑难解答