简体   繁体   中英

How do I update JAVA_HOME / JRE_HOME on Tomcat on Ubuntu 15.04?

I'm trying to set my JRE_HOME variable in catalina.bat to be where my java is stored (/usr/lib/jvm/default-java) in Ubuntu. I edited catalina.bat and added "set JAVA_HOME=/usr/lib/jvm/default-java" at the very top of the file but when I use "./catalina.sh version" it keeps stating "Using JRE_HOME: /usr". How do I setup my catalina.bat file so that the JRE_HOME will update?

I've tried a few older guides for older versions of Ubuntu but nothing has worked. Any and all help is appreciated I just want to get my computer working for java server side programming. Thanks in advance.

When you starting tomcat using catalina.bat, it searching for file setenv.bat and sourcing it. It is searching in CATALINA_HOME or CATALINA_BASE

So the better way to set JAVA_HOME for the tomcat is:

Create setenv.bat script CATALINA_BASE/bin, if it is not exists already. Add this line to setenv.bat

export JAVA_HOME=/opt/java/jdk1.8.0_05

Make it executable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM