Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


compiling servlets using Tomcat 4.1

Posted on 2004-10-26
Medium Priority
Last Modified: 2013-11-24
hi experts,

I am new to servlets. I am running them using Apache Tomcat 4.1
I have written my first HelloWorld servlet program but unable to compile it. I saved it in the following directory

C:\Program Files\Apache Group\Tomcat 4.1\webapps\ap1\WEB-INF\classes\
when i try to complie using    javac HelloWorld.java    from  the classes directory in the dos prompt, it is giving 6 errors though the program is perfect.

the class path is set as  :

 set classpath=%classpath%;c:\Program Files\Apache Group\Tomcat 4.1\common\lib;c:\lotus\notes\data

and path set as

set PATH=%PATH%;C:\J2sdk1.4.2_06\bin;%JAVA_HOME%\bin;%CATALINA_HOME%\bin

will greatly appreciate your help.


Question by:jaggernat
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

runa_paathak earned 600 total points
ID: 12418817
Hi jaggernat,

You have mentioned that the following is your classpath setting:

set classpath=%classpath%;c:\Program Files\Apache Group\Tomcat 4.1\common\lib;c:\lotus\notes\data

You are getting the compiler errors beause the compiler is not able to find the "standard" servlet classes like HttpServlet. There is a .jar file called "servlet.jar" or "servlet-api.jar" in the Tomcat 4.1\common\lib folder. You need to include this .jar file in your classpath for the compiler to be able to find the "standard" classes I mentioned above. Therefore, try changing your classpath to the following:

set classpath=%classpath%;c:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar;c:\lotus\notes\data

and compile again.

I think this will help.

LVL 10

Author Comment

ID: 12424927
yes it works.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question