How to change JAVA_HOME and JAVA_OPTS on Tomcat installed on Linux?

I have a version of Tomcat 5.5 installed on Linux with a package, and while I am used to deal with sh scripts stored in the Tomcat bin directory, here /usr/share/tomcat5/bin doesn't contain the usual scripts and Tomcat is started instead with /usr/java/latest/bin/java. Do you have any advice on how to change the JAVA_HOME and JAVA_OPTS (to set VM parameters such as heap size) in this environment?

Alex
LVL 1
avernetAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mohammedfCommented:
In the file /etc/profile add the following after "export path":

JAVA_HOME= your jdk directory e.g. /usr/lib/jdk
export JAVA_HOME

export PATH=$JAVA_HOME/bin:$PATH
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
avernetAuthor Commented:
Thank you for the tip. But I have been already trying to set JAVA_OPTS and JAVA_HOME in /etc/profile, but that didn't have any effect.

Alex
0
Ajay-SinghCommented:
Probably, you should set these parameters to the shell environment of the
user with which you are executing the tomcat startup script - probably on
his/her profile.
0
avernetAuthor Commented:
Uninstalling and reinstalling the JDK and Tomcat packages solved the problem. And after this, setting the variables in /etc/profile works. Thanks guys.

Alex
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.