I downloaded tomcat-4.0.4 and unzip the file to c:\jakarta-tomcat-4.0.4. set up the following system enviromental variables: CATALINA_HOME c:\jakarta-tomcat-4.0.4; JAVA_HOME c:\j2sdk1.4.0-beta3; PATH .;c:\j2sdk1.4.0-beta\bin; c:\j2sdk1.4.0-beta\jre;c:\j2sdk1.4.0-beta\lib; when try to start tomcat from command prompt with the startup.bat, I get the following errors: Windows cannot find-'Djava.endorsed.dirs='. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search. The JAVA_HOME environment variable is not defined correctly. This environment variable is needed to run this program. The system cannot find the batch label specified - end using CATALINE_BASE: .. using CATALINA_HOME:.. Using CATALINA_TMPDIR:..\temp Using JAVA_HOME: c:\j2sdk1.4.0-beta3;
Could any body help out on this? x.s
Joined: Jul 02, 2002
If you take a look your %CATALINA_HOME%\bin\setclasspath.bat file, you will see the following lines of code.
If the setclasspath.bat script is not able to verify the existence of the %JAVA_HOME%\bin\java.exe file, then it prints the error message that you quoted. You stated that JAVA_HOME = c:\j2sdk1.4.0-beta3; However, your path is set as follows. .;c:\j2sdk1.4.0-beta\bin; c:\j2sdk1.4.0-beta\jre;c:\j2sdk1.4.0-beta\lib; It appears to me that you have a conflict. Your JAVA_HOME property is saying that java is installed in a directory named c:\j2sdk1.4.0-beta3 but your path indicates a directory named c:\j2sdk1.4.0-beta. Either you need to remove the final character from you JAVA_HOME property or you need to add it to your PATH. To make sure that your JAVA_HOME and your PATH are in agreement, it is safer to define your PATH in terms of JAVA_HOME. For example,
You stated that your system prints the following.
If the system prints .. for CATALINA_BASE and CATALINA_HOME, then it means that CATALINA_HOME is not set. You claimed, however, that you set CATALINA_HOME as follows. CATALINA_HOME c:\jakarta-tomcat-4.0.4; Are you sure that your definition is recognized by the command prompt window that you are using? Is it possible that you are using a command prompt window that was opened before you set CATALINA_HOME in the control panel? For example, when you type the "set" command in your command prompt window does it print the CATALINA_HOME property as you expect? You also asked for help with the java.endorsed.dirs environment variable which happens to be a new feature of Java 1.4 and the Endorsed Standards Override Mechansim. XML parsers and other endorsed standards are included in the J2SE v1.4 release of Java. The java.endorsed.dirs system property is used to override the use of endorsed packages that are included in a Java release such as J2SE v1.4. The java.endorsed.dirs system property is set in your %CATALINA_HOME%\bin\setclasspath.bat file as shown below.
BASEDIR is set to CATALINA_HOME in the catalina.bat file. The sequence of events is a follows. You invoke %CATALINA_HOME%\bin\startup. The startup.bat file makes sure that CATALINA_HOME is setup properly and then it calls %CATALINA_HOME%\bin\catalina.bat. The catalina.bat script calls setclasspath.bat. The setclasspath.bat script sets the java.endorsed.dirs environment variable. I hope that above information helps.
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Joined: Jul 05, 2002
Dan Thanks very much for your help. It works now. x.s