tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Corrigan" <>
Subject RE: Tomcat4, where is classpath set when run as service
Date Wed, 30 Jul 2003 21:26:06 GMT
I'm not disputing that changing the classpath is probably not the best
option.  I do disagree with your assertion that environment variables are
referenced when Tomcat is ran as a service under Windows NT/2K/XP.  When
Tomcat is ran as a service, the scripts are not used (as a test, remove
them.)  Furthermore, when ran as a service, the environment variables do not
need to be defined, and are not automatically defined by the installation
script -- instead, the registry parameters are created.  While I have not
specifically tested setting the classpath with environment variables, I did
find that setting JVM options that way does not work.

As to portability, environment variables are not necessarily portable
either.  That is why the System.getEnv method for accessing them has been
deprecated.  Which means that the environment variables have to be read by a
script and then passed into Tomcat with -Dproperty=value.

Personally, I think that if Tomcat is started as a service that it should
utilize the environment variables.  I really don't like the concept of
sticking things in the registry.  In the long run, that approach seems to
create problems.

-----Original Message-----
From: John Turner []
Sent: Wednesday, July 30, 2003 2:02 PM
To: Tomcat Users List
Subject: Re: Tomcat4, where is classpath set when run as service

I'm pretty sure.  Editing the registry is possible, so is editing the
startup scripts.  That doesn't mean its advisable, or portable.

Tomcat has a pretty robust ClassLoader architecture specifically
designed to load classes that it needs.  Why not use it instead of
mucking about with the registry and trying to force a new/different


John Corrigan wrote:

> Are you sure about that, John?  What about the following registry key?
> Aren't the environment variables only used during the service setup
>     CurrentControlSet
>       Services
>         Apache Tomcat 4.1
>           Parameters  --  JVM Option Number 0:
> REG_SZ: -Djava.class.path=C:\usr\local\Apache\Tomcat
> 4.1.24\bin\bootstrap.jar
> It seems like the easiest way to add to the classpath, if that is really
> want you want to do Paul, is to edit the registry.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message