tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: JAVA_HOME is not found but tomcat is running. possible?
Date Fri, 17 Oct 2008 19:11:17 GMT
Thangavel Sankaranarayanan wrote:
> Hi all ,
> 
> I have a tomcat 4.x version (Perhaps it is a old version ,it is in
> production and we cant upgrade as of now).
> 
> It is running as a window service in Windows2000 server.
> in the service icon i can find the  path to executable:
> 
> 
> C:\Products\Apache Tomcat 4.1\bin\tomcat.exe
> 
> My doubt is ,does tomcat.exe needs JAVA_HOME or JRE_HOME defined to run
> tomcat in this case as we are not starting tomcat using Startup.bat or
> Catalina.bat.
> 
> If so,In my system i couldn't find any environmental varible set for
> JAVA_HOME or JRE_HOME... i can find only CATALINA_OPTS in it.
> 
> It is also not defined in any of the .bat file as well...please help me on
> this.thanks
> 
Check if you also have a tomcatw.exe in the same directory.
If yes, then it is probably an instance of this :

http://commons.apache.org/daemon
read, then click on the "procrun" link at the bottom of the page.

It sounds a bit obscure, so roughly :

The Java JVM, per se, does not run very nicely as a Windows Service, 
because it lacks the interfaces that a Windows Service needs to properly 
respond to Windows messages like "shut down service".
So procrun.exe is a program that "wraps" the JVM into a shell that does 
have these interfaces.
tomcatw.exe is just the GUI program prunmgr.exe, renamed to tomcatw.exe.
It is the GUI setup tool for procrun.exe, allowing you to tell it where 
to get its JVM, what parameters to start it with, etc..
Much like the startup.sh and catalina.sh do under Unix/Linux.
Double-click on tomcatw.exe, then select the Java panel, and you'll see 
what I am talking about.

So basically, under Windows, if you want to run Tomcat as a service, you 
do as follows :
- configure your JVM environment using tomcatw.exe (prunmgr)
- use tomcat.exe (procrun) as the executable for the Service that 
Windows will run
This tomcat.exe will start the JVM, and in the JVM Tomcat (bootstrap.jar)
This tomcat.exe will also catch the signal Windows is sending when it's 
time to shut down, and properly stop Tomcat and the JVM.

Now you see why you don't find an environment variable JAVA_HOME ?
tomcat.exe (in reality procrun) does not need it, because it finds the 
same information somewhere else (where tomcatw.exe (prunmgr) put it).
(And I am not quite sure where it puts it, probably the Registry).



---------------------------------------------------------------------
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


Mime
View raw message