Tomcat Neither the Java_home nor the JRE_HOME environment variable is defined

Source: Internet
Author: User

One can see that the JDK environment is problematic, but the JDK used so long has been well-configured, how one to Tomcat on the so sentimental.

Finally the solution, originally my JDK was downloaded directly from the official website, although I modified the java_home, but not too smart Tomcat still does not automatically identify the java_home path.

Linux Workarounds:
Edit the file/usr/local/tomcat/bin/catalina.sh (modified according to your own JDK path) at the beginning of the body of the file, that is, before the official code, about 99 lines to add the following code

1 exportJAVA_HOME=/usr/local/jdk
2 exportJRE_HOME=/usr/local/jdk/jre

After the change, it's probably like this.

View Source
01 # $Id: catalina.sh 1202062 2011-11-15 06:50:02Z mturk $
02 # -----------------------------------------------------------------------------
03
04 exportJAVA_HOME=/usr/local/jdk
05 exportJRE_HOME=/usr/local/jdk/jre
06
07 # OS specific support.  $var _must_ be set to either true or false.
08 cygwin=false
09 darwin=false
10 os400=false
11 case"`uname`"in
12 CYGWIN*) cygwin=true;;
13 Darwin*) darwin=true;;
14 OS400*) os400=true;;
15 esac .....................

Note: Under Windows, modify the corresponding Catalina.bat

http://blog.csdn.net/zhangpengyu321/article/details/12144497

To configure the Tomcat reference:

http://blog.csdn.net/ithomer/article/details/7827045

Tomcat Neither the Java_home nor the JRE_HOME environment variable is defined

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.