Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set CATALINA_HOME variable in windows 7?

I have downloaded apache-tomcat-7.0.35. My JDK version is jdk1.6.0_27.

How do I configure CATALINA_HOME as an environment variable and how do I run Tomcat server under Windows 7?

like image 805
VinaySV Avatar asked Jan 29 '13 09:01

VinaySV


People also ask

What should Catalina_home be set to?

The CATALINA_HOME environment variable should be set to the location of the root directory of the "binary" distribution of Tomcat. The Tomcat startup scripts have some logic to set this variable automatically if it is absent, based on the location of the startup script in *nix and on the current directory in Windows.

Where is Catalina_home defined?

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. Follow this answer to receive notifications.

Where should a Catalina house be placed?

By default, CATALINA_HOME is /usr/share/tomcat6 , and CATALINA_BASE is /var/lib/tomcat6 . In either Tomcat6 or Tomcat7 installed with Apt-Get, find the declarations of CATALINA_HOME and CATALINA_BASE, in /etc/init. d/tomcat6 or tomcat7, and EXPORT them to the OS variables.


2 Answers

Setting the JAVA_HOME, CATALINA_HOME Environment Variable on Windows

One can do using command prompt:

  1. set JAVA_HOME=C:\ "top level directory of your java install"
  2. set CATALINA_HOME=C:\ "top level directory of your Tomcat install"
  3. set PATH=%PATH%;%JAVA_HOME%\bin;%CATALINA_HOME%\bin

OR you can do the same:

  1. Go to system properties
  2. Go to environment variables and add a new variable with the name JAVA_HOME and provide variable value as C:\ "top level directory of your java install"
  3. Go to environment variables and add a new variable with the name CATALINA_HOME and provide variable value as C:\ "top level directory of your Tomcat install"
  4. In path variable add a new variable value as ;%CATALINA_HOME%\bin;
like image 102
Zeeshan Akhter Avatar answered Sep 24 '22 10:09

Zeeshan Akhter


Assuming Java (JDK + JRE) is installed in your system, do the following steps:

  1. Install Tomcat7
  2. Copy 'tools.jar' from 'C:\Program Files (x86)\Java\jdk1.6.0_27\lib' and paste it under 'C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\lib'.
  3. Setup paths in your Environment Variables as shown below:

C:>echo %path%

C:\Program Files (x86)\Java\jdk1.6.0_27\bin;%CATALINA_HOME%\bin; 

C:>echo %classpath%

C:\Program Files (x86)\Java\jdk1.6.0_27\lib\tools.jar; C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\lib\servlet-api.jar; 

C:>echo %CATALINA_HOME%

C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0; 

C:>echo %JAVA_HOME%

C:\Program Files (x86)\Java\jdk1.6.0_27; 

Now you can test whether Tomcat is setup correctly, by typing the following commands in your command prompt:

C:/>javap javax.servlet.ServletException C:/>javap javax.servlet.http.HttpServletRequest 

It should show a bunch of classes

Now start Tomcat service by double clicking on 'Tomcat7.exe' under 'C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\bin'.

like image 37
shasi kanth Avatar answered Sep 22 '22 10:09

shasi kanth