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.