解决Linux下启动Tomcat遇到Neither the JAVA_HOME ...报错
来源:互联网 发布:c语言捕鱼 编辑:程序博客网 时间:2024/04/30 11:36
tomcate的bin里面的setclasspath.sh文件添加
export JAVA_HOME=/home/jdk1.8.0_111
export JRE_HOME=/home/jdk1.8.0_111/jre
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -----------------------------------------------------------------------------
# Set JAVA_HOME or JRE_HOME if not already set and ensure any provided
# settings are valid and consistent with the selected start-up options.
# -----------------------------------------------------------------------------
export JAVA_HOME=/home/jdk1.8.0_111
export JRE_HOME=/home/jdk1.8.0_111/jre
# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
if $darwin; then
# Bugzilla 54390
if [ -x '/usr/libexec/java_home' ] ; then
export JAVA_HOME=`/usr/libexec/java_home`
# Bugzilla 37284 (reviewed).
elif [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home"
fi
else
JAVA_PATH=`which java 2>/dev/null`
if [ "x$JAVA_PATH" != "x" ]; then
JAVA_PATH=`dirname $JAVA_PATH 2>/dev/null`
JRE_HOME=`dirname $JAVA_PATH 2>/dev/null`
fi
if [ "x$JRE_HOME" = "x" ]; then
# XXX: Should we try other locations?
if [ -x /usr/bin/java ]; then
JRE_HOME=/usr
fi
fi
fi
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
echo "At least one of these environment variable is needed to run this program"
exit 1
fi
fi
if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
echo "JAVA_HOME should point to a JDK in order to run in debug mode."
exit 1
fi
if [ -z "$JRE_HOME" ]; then
JRE_HOME="$JAVA_HOME"
fi
# If we're running under jdb, we need a full jdk.
if [ "$1" = "debug" ] ; then
if [ "$os400" = "true" ]; then
if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ]; then
echo "The JAVA_HOME environment variable is not defined correctly"
echo "This environment variable is needed to run this program"
echo "NB: JAVA_HOME should point to a JDK not a JRE"
exit 1
fi
else
if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x "$JAVA_HOME"/bin/javac ]; then
echo "The JAVA_HOME environment variable is not defined correctly"
echo "This environment variable is needed to run this program"
echo "NB: JAVA_HOME should point to a JDK not a JRE"
exit 1
fi
fi
fi
# Set standard commands for invoking Java, if not already set.
if [ -z "$_RUNJAVA" ]; then
_RUNJAVA="$JRE_HOME"/bin/java
fi
if [ "$os400" != "true" ]; then
if [ -z "$_RUNJDB" ]; then
_RUNJDB="$JAVA_HOME"/bin/jdb
fi
fi
0 0
- 解决Linux下启动Tomcat遇到Neither the JAVA_HOME ...报错
- 解决Linux下启动Tomcat遇到Neither the JAVA_HOME ...报错
- 解决Linux下启动Tomcat遇到Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Linux下Tomcat启动报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one
- Linux下tomcat启动Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of
- BUG_tomcat启动报错Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- 向linux中上传文件后,重启tomcat报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At le
- 向linux中上传文件后,重启tomcat报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At le
- 使用ansible远程命令报错:Neither the JAVA_HOME 。。。
- 启动tomcat时报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 的解决方案
- 启动tomcat时报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 的解决方案
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 完美解决(tomcat error)
- linux安装tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- linux安装tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- linux安装tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- linux下启动tomcat报错:The BASEDIR environment...
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 错误&&Eclipse 访问tomcat首页报404错误
- 启动Tomcat异常(Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of )
- 关于数组与字符串的使用
- Node.js NPM国内镜像
- sql数据库备份成sql脚本
- 使用Akka的远程调用
- JAVA切换jdk
- 解决Linux下启动Tomcat遇到Neither the JAVA_HOME ...报错
- Uva 10288 Coupons (概率dp)
- EL表达式
- PHP刚做完的一个商品专区异步加载和页面搜索,抽空整理mark下...
- M - Children of the Candy Corn (第一次写左右优先的搜索,自己独立写的可能不够优化)
- Python模块常用的几种安装方式
- 码农、黑客和2B程序员之间的区别
- 微信小程序会替代原生APP吗?
- 关于工作的心得。