?
Solved

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

Posted on 2008-02-05
4
Medium Priority
?
8,955 Views
Last Modified: 2013-12-02
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
0
Comment
Question by:avernet
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
mohammedf earned 320 total points
ID: 20825895
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
 
LVL 1

Author Comment

by:avernet
ID: 20826136
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
 
LVL 23

Assisted Solution

by:Ajay-Singh
Ajay-Singh earned 80 total points
ID: 20828466
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
 
LVL 1

Author Comment

by:avernet
ID: 20828695
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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Suggested Courses

593 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question