You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Lawrence A. Quinn" <LA...@landacorp.com> on 2007/12/19 19:12:29 UTC

selecting java version

Can tomcat be configured to use a different version of java than what is
listed in java_home?   Where does that configuration information reside?
LAQ


Re: selecting java version

Posted by Wesley Schwengle <we...@orange-ftgroup.com>.
On 19.12.07 10:12 Lawrence A. Quinn wrote:

> Can tomcat be configured to use a different version of java than what is
> listed in java_home?   Where does that configuration information reside?

Funny that you mention this, as I just completed a project at work to
deal with something similar.

We have a configuration file to control which webapplications can be
started on a server and which java version and tomcat version is used.

In this file we define which webapplication is used and which ports are
used for tomcat and mod_jk, the ports are then used to create a minimal
server.xml for each webapp and the paths shown in the file are then used
to set the various enviroment variables (JAVA_HOME, CATALINA_HOME,
JAVA_OPTS).

Here's a sniplet of the configfile:

# channel_name:webapp_name:server_port:service_port:mem_min:mem_max:host:framework:flags:java_home:tomcat_home:java_lib_path
remedy:remedy:8001:8011:64:64:slacker:xins:remedy:/usr/local/j2sdk1.5.0_05:/usr/local/tomcat:/opt/remedy71p1/lib

Based on these parameters we can configure each instance of tomcat to
use a different java version. But be aware, if you change the tomcat
version, you will probably need to create a new server.xml (this I found
out the hard way..).

We control all the webapplications via a custom build perl script which
enables us to setup the mod_jk.conf, the workers.properties and the
server.xml for all webapplications defined in our config file. The same
script also is used to stop/start the webapplications and to check the
status of each application (is it running, is the port already in use
etc etc).

I don't know if this is the official way for managing multiple tomcat instances
but it works, and works well.

Hope this helps :)

Cheers,
Wesley

-- 
Orange Nederland Breedband BV, http://www.orange.nl & http://www.equant.nl & http://www.euronet.nl
Wesley Schwengle, System Administrator, IT Operations - Business Systems

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: selecting java version

Posted by Gabe Wong <ga...@ngasi.com>.
Lawrence A. Quinn wrote:
> Can tomcat be configured to use a different version of java than what is
> listed in java_home?   Where does that configuration information reside?
> LAQ
>
>
>   
Hi Lawrence, you never specified which OS you are on, but in general you 
set the JAVA_HOME environment variable by editing either
./bin/startup.sh or ./bin/startup.bat like so:
NIX:
export JAVA_HOME=/usr/java/custom_jdk
export JRE_HOME=$JAVA_HOME

WIN:
set JAVA_HOME=c:\usr\java\custom_jdk
set JRE_HOME=%JAVA_HOME%

-- 
Regards

Gabe Wong
NGASI AppServer Manager
Application server installation and configuration AUTOMATION
http://www.ngasi.com


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org