2

I have installed JDK 7 and tomcat 7 and set the following environment variables:

PATH: ......C:\Progra~1\Java\jdk1.7.0_51;F:\apache-tomcat-7.0.52-windows-x86\apache-tomcat-7.0.52\bin;
CATALINA_HOME: F:\apache-tomcat-7.0.52-windows-x86\apache-tomcat-7.0.52;
JAVA_HOME: C:\Progra~1\Java\jdk1.7.0_51;
JRE_HOME: C:\Progra~1\Java\jre7;

When I try to run the command catalina.bat, it throws the following error:

The CATALINA_HOME environment variable is not defined correctly 
This environment variable is needed to run this program.

when executing the command setclasspath.bat, it's throwing the following error:

The JRE_HOME environment variable is not defined correctly
This environment variable is needed to run this program.

and when I try to execute the command service.bat, the error is:

The tomcat7.exe was not found...
The CATALINA_HOME environment variable is not defined correctly.
This environment variable is needed to run this program".

And also when I try to execute %CATALINA_HOME% from RUN, the error message says:

Windows cannot find the path.

What could be the problem here?

1
  • Where do you set the environment variables? And, what user are you using to run the batch files? – pepoluan Mar 1 '14 at 13:07
5

It looks like you have an extra semicolon at the end of the CATALINA_HOME variable (and others). Try with:

F:\apache-tomcat-7.0.52-windows-x86\apache-tomcat-7.0.52

instead of

F:\apache-tomcat-7.0.52-windows-x86\apache-tomcat-7.0.52;
1
  • @ David Removing ; at the end of the variables worked for me. Thanks many!! :) – Ashu Mar 3 '14 at 5:38
1

Setting the JAVA_HOME , CATALINA_HOME Environment Variable on Windows

The simplest way to do this in most Windows cases is to set environment variables:

On Win 7:

Control Panel -> System -> Advanced system settings -> Advanced (tab) -> Environment Variables (button)

4
  • @David Levesque may have the correct answer, I never realized that semicolon is significant in NTFS pathnames. – quadruplebucky Mar 1 '14 at 13:17
  • I've been told that just providing a link as an anwser without any further explanations was not a best practice here...The link could be dead one day so we will have no more trace about what it was talking about – krisFR Mar 1 '14 at 13:17
  • Fair point. Will correct. – quadruplebucky Mar 1 '14 at 13:18
  • @ David Removing ; at the end of the variables worked for me. Thanks many!! :) – Ashu Mar 3 '14 at 9:39
0

Every instance of CMD started by a user, including the implicit instance automatically started when you run a batch file via Start>Run, inherits the environment settings of the current user.

You must set the environment variables for the user, instead of via a Command Prompt, because if you set environment variables via the Command Prompt, the environment will be effective only for that particular instance of the Command Prompt.

I forgot exactly where (I don't have my laptop with me at the moment), but it's somewhere within the "Advanced Settings" dialog box (reachable via Win+Break).

0

on win7 start window type env it will directly open environment variable window set this paths-

JAVA_HOME=C:\Program Files\Java\jdk1.8 (add path where your java is installed)
JRE_HOME=add path where your jre is installed
Catalina_home=add path where your tomcat is installed

in path variable just add %CATALINA_HOME%\lib

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.