I'm trying to get Apache Tomcat set up on a Windows Server 2003 machine. If I use the command line version (
catalina.bat start) it all works fine, but if I try and use it as a Windows Service it seems to pick up the wrong value for
JAVA_HOME - it ignores the environment variable I have set, and it's using the runtime path rather than the JDK path. As a result, my scripts won't compile and the app fails to run.
I'm using pretty old version of everything: Tomcat 4 and Java 1.4.2_19 (it's a legacy app that I don't have time to update at the mo - I just want to get it running, for phase 1).
I have the JDK installed to
C:\j2sdk1.4.2_19 and Tomcat installed to
C:\Program Files\Apache Software Foundation\Tomcat 4.1. The "Java Virtual Machine" setting for the service is set to
JAVA_HOME environment variable is set to
When I try and launch my app, it writes the following error to the log:
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the
classpath. Perhaps JAVA_HOME does not
point to the JDK. It is currently set
i.e. it's added an extra "
\jre" to the
JAVA_HOME that shouldn't be there!
I also wondered whether it might be a registry setting somewhere, but I looked in all the obvious places.
HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\Tomcat4\Parameters\Java\JavaHome is set to the same as the
JAVA_HOME environment variable, as is the
JavaHome key under places like
JavaSoft\Java Development Kit\1.4 and
JavaSoft\Java Runtime Environment\1.4.2_19.
I'm starting to get rather frustrated trying to figure out why it won't work!