installing tomcat on windows 7

22
PREPARED BY RAVI KUMAR LANKE Page 1 Installing Tomcat On Windows 7

Upload: ravi-kumar-lanke

Post on 13-May-2015

376 views

Category:

Education


5 download

DESCRIPTION

Installing tomcat on windows 7

TRANSCRIPT

PREPARED BY RAVI KUMAR LANKE Page 1

Installing Tomcat On Windows 7

PREPARED BY RAVI KUMAR LANKE Page 2

Installing Java

Tomcat requires java in order to run. If your computer already has java installed, you can probably skip

this step. However, make sure you have a recent version of java.

Setting the Java Environment Variable

Tomcat will need to know where you have installed java. To do this, you will need to set the

environment variable JAVA_HOME

Here are the steps for setting the environment variable

Goto start and right click on computer and click on properties

PREPARED BY RAVI KUMAR LANKE Page 3

Click on Advanced System Settings

PREPARED BY RAVI KUMAR LANKE Page 4

Click on Environment Variables

PREPARED BY RAVI KUMAR LANKE Page 5

Click on New

PREPARED BY RAVI KUMAR LANKE Page 6

Give Variable Name and Variable Value and click ok

Click ok and ok

PREPARED BY RAVI KUMAR LANKE Page 7

Installing Tomcat

After setting the JAVA_HOME environment variable, you can install tomcat

Go to the Tomcat software folder

Run the exe file.

I suggest you install Tomcat at c:\tomcat

Use the default settings and provide a password that you will remember

PREPARED BY RAVI KUMAR LANKE Page 8

PREPARED BY RAVI KUMAR LANKE Page 9

PREPARED BY RAVI KUMAR LANKE Page 10

PREPARED BY RAVI KUMAR LANKE Page 11

PREPARED BY RAVI KUMAR LANKE Page 12

PREPARED BY RAVI KUMAR LANKE Page 13

Running Tomcat

Here are the steps to see if Tomcat has been successfully installed

Start Tomcat by finding its start program in the Programs Menu (located in the Start menu). Look under

Apache Tomcat and select "Start Tomcat"

Open a Web browser and type in the following URL:

http://localhost:8080/

PREPARED BY RAVI KUMAR LANKE Page 14

PREPARED BY RAVI KUMAR LANKE Page 15

PREPARED BY RAVI KUMAR LANKE Page 16

At this point, you should see the Tomcat home page, which is provided by the Tomcat

Web server running on your computer. Note: if your computer has an internet name or

an IP number, you may access your Tomcat server anywhere on the internet by

substituting localhost with the full name or IP number.

To shut down your server and remove the Console window, select "Stop Tomcat" in

the same menu of where you selected "Stop Tomcat".

PREPARED BY RAVI KUMAR LANKE Page 17

PREPARED BY RAVI KUMAR LANKE Page 18

Set Your CLASSPATH

Since servlets and JSP are not part of the Java 2 platform, standard edition, you have

to identify the servlet classes to the compiler. The server already knows about the

servlet classes, but the compiler (i.e., javac) you use for development probably

doesn't. So, if you don't set your CLASSPATH, attempts to compile servlets, tag libraries,

or other classes that use the servlet and JSP APIs will fail with error messages about

unknown classes. Here are the standard Tomcat locations:

Tomcat : c:\tomcat\lib\servlet.jar

in addition to the servlet JAR file, you also need to put your development directory in

the CLASSPATH. Although this is not necessary for simple packageless servlets, once

you gain experience you will almost certainly use packages. Compiling a file that is in

a package and that uses another class in the same package requires the CLASSPATH to

include the directory that is at the top of the package hierarchy. In this case, that's the

development directory I just discussed. Forgetting this setting is perhaps the most

common mistake made by beginning servlet programmers!

Finally, you should include "." (the current directory) in the CLASSPATH. Otherwise,

you will only be able to compile packageless classes that are in the top-level

development directory.

PREPARED BY RAVI KUMAR LANKE Page 19

Click ok ok ok and close the window

PREPARED BY RAVI KUMAR LANKE Page 20

Set Your CATALINA_HOME :

Click ok ok ok and close the window

PREPARED BY RAVI KUMAR LANKE Page 21

Click ok ok ok and close the window

PREPARED BY RAVI KUMAR LANKE Page 22

ENVIRONMENT VARIABLES SETTINGS FOR TOMCAT :

1. Right click on My Computer. 2. Select Properties. 3. Select the Advanced tab. 4. Select the Environmental Variables button. 5. Under the System Variable group, select New. 6. In the Variable Name field, type JAVA_HOME. 7. In the Variable Value field, type the name of the path to your

JVM (e.g., C:\Java). 8. Select OK. 9. Under the System Variable group, select New. 10. In the Variable Name field, type CATALINA_HOME. 11. In the Variable Value field, type the name of the path to

Tomcat (e.g., C:\Tomcat). 12. Select OK. 13. Select OK. 14. Select OK.