The Classpath and Search Path

printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    

JSTL: JSP Standard Tag Library Kick Start
By Jeff Heaton

Table of Contents
Appendix B.  Installing JSTL and Tomcat


It is usually a good idea to make the BIN directory for the JDK a part of the system search path. Doing this will allow you to type the command javac from any directory and be able to compile a program. You also have to modify your classpath so that certain Tomcat JAR files are available to the Java compiler. You must do this in order to execute the examples from Chapter 11.

Both the classpath and system search path are defined in the same area. If you are using Windows XP, Windows 2000 Pro, or Windows NT, you set them in the System window in Control Panel, as shown in Figure B.6.

Figure B.6. The System window.

graphics/bfig06.jpg

You have to modify the system path to include the path of your JDK's BIN directory. The system path is stored in the environment variable named PATH. Your JDK BIN directory is most likely C:\j2sdk1.4.0\bin or something similar. Add this path to your PATH environment variable.

In addition, you have to add a few JAR files to your classpath. This allows the Java compiler to correctly compile the tag library that we create in Chapter 11. If you do not want to modify your classpath, you can modify the Chapter 11 script files to include the required classpath, as shown here:

C:\Program Files\Apache Tomcat 4.0\webapps\ROOT\WEB-INF\lib\mm.mysql-2.0.12-bin.jar C:\Program Files\Apache Tomcat 4.0\common\lib\servlet.jar C:\Program Files\Apache Tomcat 4.0\webapps\ROOT\WEB-INF\lib\jstl.jar C:\Program Files\Apache Tomcat 4.0\webapps\ROOT\WEB-INF\lib\standard.jar 

The first file is the MM driver that allows us to access the MySQL database. The second file, servlet.jar, allows us to access the servlet context variables. The last two lines enable us to access the JSTL tag library; this is important because the tag library that we create in Chapter 11 is designed to work with the tag library.


    printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    
    Top

    [0672324504/app02lev1sec4]

     
     


    JSTL. JSP Standard Tag Library Kick Start
    JSTL: JSP Standard Tag Library Kick Start
    ISBN: 0672324504
    EAN: 2147483647
    Year: 2001
    Pages: 93
    Authors: Jeff Heaton

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net