Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling Servlets

Status
Not open for further replies.

LuckyKoen

Programmer
Feb 14, 2005
57
BE
I downloaded J2EE and it supports servlets, but when I try to compile my servlet the compiler still can't find the servlet classes. I have the following 2 imports on the top of my servlet that are unknown to the compiler :

import java.servlet.*;
import java.servlet.http.*;

How should I get my servlet to work ?
 
you need to pass the location of the servlet-api.jar to javac using the -classpath option

eg
javac -classpath /opt/tomcat/common/lib/servlet-api.jar myprogram.java
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top