37

I installed Apache Tomcat 6.0 to a C:/Program Files folder and I set the environmental variables JAVA_HOME and CATALINA_HOME, but when I start the server using startup.bat, I am getting the error:

CATALINA_HOME environmental variable is not defined correctly.

My CATALINA_HOME environment variable is set to CATALINA_HOME=C:\Program Files\apache-tomcat-6.0.35.

What did I do wrong?

roottraveller
  • 7,942
  • 7
  • 60
  • 65
krishna bhargavi
  • 961
  • 4
  • 15
  • 24
  • 1
    Well, the first question is whether Tomcat is in `C:\Program Files\apache-tomcat-6.0.35`? In other words, is there a `C:\Program Files\apache-tomcat-6.0.35\bin`, `C:\Program Files\apache-tomcat-6.0.35\wepapps`, `C:\Program Files\apache-tomcat-6.0.35\common`, etc? – Ernest Friedman-Hill Feb 20 '12 at 13:38
  • yeah tomcat is in c:\Program Files\apache-tomcat-6.0.35 – krishna bhargavi Feb 20 '12 at 13:48
  • 3
    After you set the environment variable, did you open a new CMD.EXE window? Windows that existed before you set the variables won't see them, only new windows will. – Ernest Friedman-Hill Feb 20 '12 at 14:16

9 Answers9

30

At first you have to mention tomcat up to tomcat's version refer below

CATALINA_HOME: C:\Program Files\apache-tomcat-6.0.35; then set CLASSPATH variable to

CLASSPATH : C:\Program Files\apache-tomcat-6.0.35\lib;

then finally edit path variable to PATH: .;%CATALINA_HOME%\bin;

NOTE: a semicolon(;) must be put at the end of each and every variable.

R. Schreurs
  • 8,587
  • 5
  • 43
  • 62
Rohith
  • 991
  • 4
  • 18
  • 31
  • If you add a semicolon to the end of CATALINA_HOME, then try to use that variable in the PATH, you'll end up with `C:\Program Files\apache-tomcat-6.0.35;\bin` and that path won't resolve. In fact, DON'T put a semicolon at the end of each and every variable. – Machtyn Aug 14 '18 at 16:46
17
set JAVA_HOME :C:\Program Files\Java\jdk1.6.0_26
CLASSPATH :C:\Program Files\Java\jdk1.6.0_26\bin
CATALINA_HOME : C:\Program Files\apache-tomcat-6.0.35
j0k
  • 22,600
  • 28
  • 79
  • 90
Sudarshan
  • 350
  • 4
  • 11
11

Make sure you cd your directory on the cmd window to the path where the Tomcat is before you you call the service.bat file

Atilla
  • 111
  • 1
  • 2
6

Open up your catalina.bat / catalina.sh .. and check for CATALINA_HOME , this could have been hardcoded if you have copied Tomcat from somewhere.

MItesh
  • 61
  • 1
  • 1
  • Yes, I found the CATALINA_HOME in my vm was set to another value which does not exist. This answer saved my time. Thanks. – Evan Hu Nov 22 '18 at 06:06
3

I have got the same problem, I copied the path location of JRE_HOME

JRE_Home= "C:Progra******** ;"

Here i have entered Semicolon which we should not , I removed it, then Tomcat Started successfully .

So Semicolon must be removed at the end after setting path JRE_HOME or JAVA_HOME or CATALINA_HOME .

Vikas Kalapur
  • 415
  • 4
  • 12
2

You also need to set the JAVA_HOME variable to point to the JDK, not JRE. Tomcat must know were Java is installed. It needs the JDK. In the end restart computer.

https://serverfault.com/questions/579159/the-catalina-home-environment-variable-is-not-defined-correctly-this-environment

Community
  • 1
  • 1
Alex
  • 1,066
  • 2
  • 9
  • 15
1

Please care to remove the semi colon at the end of defining user variables such as JAVA_HOME, CATALINA_HOME

Lukman
  • 101
  • 1
  • 1
  • 9
0

In environment variables define CATALINA_HOME as a new variable and the value for the variable value assign to >>> C:\apache\apache-tomcat-7.0.40

in the path append this %CATALINA_HOME%\bin to get the command "catalina start" to work

RCR
  • 529
  • 9
  • 15
0

Set the CATALINA_HOME : C:\apache-tomcat-9.0.27 The path of the Tomcat directory (no need to add "bin") CLASSPATH : C:\apache-tomcat-9.0.27\lib

For Windows 10 newer versions, remove the ";" and update each entry to the PATH variable

%PATH%;
%JAVA_HOME%\bin;
%CATALINA_HOME%\bin;
%CLASSPATH%\servlet-api.jar;