File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Steps 2 and 4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Steps 2 and 4 " Watch "Steps 2 and 4 " New topic

Steps 2 and 4

Rami Sawas
Ranch Hand

Joined: Jan 25, 2004
Posts: 41
1. Download Java SDK and install it
2. Set your environment variable, JAVA_HOME should point to the SDK installation dir, PATH=%JAVA_HOME%\bin;%PATH%(windows)
3. Download and install tomcat, ie, download the zip file and unzip it
4. Goto TOMCATROOT\bin in a command prompt
5. Type startup.bat
then open a browser, point it to

These are the steps adviced to me. I have 2 questions ..points number 2 and 4.
For point number 2, where do I set the environment variable? When I opened Tomcat, it asked me to select a path of the JVM (Java Virtual Machine) on my system, so I selected the SDK file.
Now I can go to click on Start button, go to Tomcat folder and select "Start Tomcat". It works but I don't know what should happen if Tomcat works. An icon appears at the bottom right of the screen which if I click on it gives me a list of lines.
Does it mean my Tomcat is working fine?
For point 4 and 5, I went to DOS but couldn't figure out how to go to TOMCATROOT\bin
Lastly it gives me an error when I visit http://localhost:8080/, I think that's because I still haven't cofigured Tomcat properly.

Your reply is deeply appreciated.
Rami Sawas
Ranch Hand

Joined: Jan 25, 2004
Posts: 41
I forgot to mention about one thing, I've tried right clicking on My Computer, go to Properties, go to Advanced, go to Environment Variable but didn't know what do to next.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13024
At the environment properties dialog, click the New button under either system variables or user variable, then enter the name and value. Then any Command Prompt window you open will have those variables - verify by opening a command prompt window and entering set.
For navigating the "current directory" in a command prompt, you change drives with just the drive letter-colon (as E: to change to drive E changing directory within a drive is the CD command - try windows help for "chdir". Basically something like:
cd \Servers\Tomcat-4.1.27\bin
where \ means starting at the drive root and the rest is a directory path.
You really should execute startup.bat from a command prompt so you can see what happens.
Rami Sawas
Ranch Hand

Joined: Jan 25, 2004
Posts: 41
Thanks alot!!
When setting the PATH variable, I noticed I have 2 ways to go to SDK. One is C:\j2sdk1.4.2_03 and the other is C:\Program Files\Java\j2re1.4.2_03
Rami Sawas
Ranch Hand

Joined: Jan 25, 2004
Posts: 41
I have to mention something...
When installing SDK, it gave me 4 options to choose from
1)Development Tools
3)Source Code
4)Public Java Runtime Environment
Not sure now which one is most suitable for Tomcat..
Rami Sawas
Ranch Hand

Joined: Jan 25, 2004
Posts: 41
If Tomcat needs Public Java Runtime Environment option, then it is C:\Program Files\Java\j2re1.4.2_03
Because when installing Public Java Runtime Environment, it gave it a different special folder, where as the other three options are all in C:\j2sdk1.4.2_03
Thanks for your help.
Rami Sawas
Ranch Hand

Joined: Jan 25, 2004
Posts: 41
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

You will not be able to compile JSP's if all you supply Tomcat with is a JRE (which you seem to have done?)

You should point JAVA_HOME to your JDK directory, and then choose that for Tomcat.
Rami Sawas
Ranch Hand

Joined: Jan 25, 2004
Posts: 41
I set JAVA_HOME to SDK folder...and...pointed Tomcat to that SDK folder.
Opened Tomcat and runned it, pointed my browser to http://localhost:8080, the page said to me 'congradulations....etc'
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
It will help to have a file explorer like "Total Commander". This tool has easy traversal through your windows directories and can invoke command prompt from the file explorer itself(than doing cd ../.. etc)
You can download the Total Commander from the web.
If you do not have a IDE, you can use free editor like Crimson, which can also be downloaded from the web.

SCJP, blog
I agree. Here's the link:
subject: Steps 2 and 4
It's not a secret anymore!