Tomcat/JSF Installation Instructions

Required Skills

Installation Instructions

  1. Locate the latest stable version of Tomcat from http://jakarta.apache.org/tomcat/. You want the binary distribution, not source.
  2. To minimize installation complexities, choose the "zip" file.
  3. Save the zip file (named something like jakarta-tomcat-5.5.7.zip) to your computer.
  4. Unzip the file into a directory of your choice (such as /usr/local or c:\). The program is contained in a subdirectory named something like jakarta-tomcat-5.5.7.
    NOTE: For your own sanity, do not unzip into a directory containing spaces (such as Program Files or My Documents).
  5. Download the latest version of the JSF Reference Implementation from http://java.sun.com/j2ee/javaserverfaces/download.html
  6. Save the zip file (named something like jsf-1_1_01.zip) to your computer.
  7. Unzip the file into a directory of your choice (such as /usr/local or c:\). The program is contained in a subdirectory named something like jsf-1_1_01.
    NOTE: For your own sanity, do not unzip into a directory containing spaces (such as Program Files or My Documents).
  8. Copy all JAR files files from the lib subdirectory of your JSF installation (such as c:\jsf-1_1_01\lib) to the common/lib subdirectory of Tomcat (such as c:\jakarta-tomcat-5.5.7\common\lib). At the time of this writing, these files are
  9. Copy the following two JAR files from the webapps/jsp-examples/WEB-INF/lib subdirectory of your Tomcat installation (such as c:\jakarta-tomcat-5.5.7\webapps\jsp-examples\WEB-INF\lib) to the common/lib subdirectory of Tomcat (such as c:\jakarta-tomcat-5.5.7\common\lib):

Starting and Stopping Tomcat

  1. Open a command shell and change your directory to the Tomcat directory (such as /usr/local/jakarta-tomcat-5.5.7 or c:\jakarta-tomcat-5.5.7)
  2. Change to the bin subdirectory
  3. Type startup.sh (Unix) or startup.bat (Windows) followed by ENTER



  4. Point your web browser to http://localhost:8080. You should get a "Congratulations" page.



  5. To stop the Tomcat server, type shutdown.sh (Unix) or shutdown.bat (Windows) followed by ENTER.

Building Applications

  1. Create a subdirectory with the name of your web application (such as myproject) inside the webapps directory of your Tomcat directory (such as c:\jakarta-tomcat-5.5.7\webapps\myproject)
  2. Inside that subdirectory, create the following directory structure:
    myproject
       WEB-INF    
          classes
             mypackage         


  3. Place your files as follows:
    Here is an example:

    .
  4. Compile your beans, from the classes directory. Open a shell and issue commands similar to these:
    cd c:\jakarta-tomcat-5.5.7\webapps\myproject\WEB-INF\classes
    javac mypackage\*.java
  5. Point your browser to http://localhost:8080/myproject/index.faces. (NOT .jsp!)
    Your application should start.

    .

Troubleshooting tips