Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Sir I have an ERP, which runs catalina on tomcat. to run this i need java to be installed. Now my JAVA_HOME is usr/bin/java but i have a catalina.sh script which i want to run on boot. to do that i added the catalina.sh file in rc.local. but when the system boots it says JAVA_HOME variable needs to be declared. for that program it uses java from a different location.

for example: i need to run the file from: /home/ambee/jakarta/catalina.sh to run this file i need to show the java_home to: /home/ambee/jakarta/java but the system doesn't look for that on booting it goes to the default location of /usr/bin/java

Please give me a solution if possible.

thanks

share|improve this question

1 Answer 1

Add export JAVA_HOME="/usr/bin/java" to the top of the file if you must use your script in rc.local,

A better alternative is to add . /path/to/yourscript.sh in the /etc/init.d/tomcat script under the start call, this literally includes your sh script.

From there just run with chkconfig tomcat5 on to start the services post boot.

Note however updates to tomcat that update the init.d script may break this change and you will want to move your script out of a home directory and into somewhere like /usr/share

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.