Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2005, 07:32 PM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to compile servlet?

Hello everyone,

I want to compile simple servlet which shows on the browser hello world.
I have jdk1.5 and tomcat 4.1 on windowx XP
I have given classpath = C:\tomcat1.4\comman\lib\servlet.jar
and java_home = C:\jdk1.5
Please help me!!!
whenever I compile it throws pacakge javax.servlet.http does not exist.
 
Old March 8th, 2005, 12:47 AM
Authorized User
 
Join Date: Mar 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi monali,
          i was facing similar problem earlier.i have given the class path in the environment variable itself.but i got the same error every times.i typed the classpath command in the command prompt every time.now its working.
like
set CLASSPATH=.;C:\Program Files\Apache Tomcat 4.0\common\lib\servlet.jar

i have inserted this line in my autoexec.bat file so i thought no need to set classpath everytime.
then i got the same error.
so whenever i want to execute a servlets or jsp program i will execute the command from the command prompt.

bye

Sonnu

 
Old March 22nd, 2006, 06:03 AM
Authorized User
 
Join Date: Mar 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Pls check whether servlet-api.jar or servlet.jar.

In case of Tomcat 5.0, servlet-api.jar is correct

 
Old June 23rd, 2006, 08:41 AM
Authorized User
 
Join Date: Jun 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ajit
Default

servlet-api.jar

Ajit
 
Old December 26th, 2006, 04:44 PM
Authorized User
 
Join Date: Dec 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shahhussain Send a message via Yahoo to shahhussain
Default

Hello I was facing the same problem in my first servlet but now i can run my servlet I am having the jdk1.5 with apache tomcat 4 with window xp sp2 and i have set the environment variables as :
-------------------for JAVA_HOME---------
variable Name = JAVA_HOME
variable value = C:\Program Files\Java\jdk1.5.0_09
---------------for CATALINE_HOME------
variable name = CATALINA_HOME
variable name = C:\Program Files\Apache Group\Tomcat 4.1
-------------FOR CLASSPATH-----------
variable name = CLASSPATH
variable value = C:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet-api.jar;C:\Program Files\Apache Group\Tomcat 4.1\common\lib\jsp-api.jar;.;
-----------------------------------------
Note that I have pasted the jsp-api.jar and servlet-api.jar in my common lib directory from another version of apache tomcat.
also that the variables name and values are case sensitive
sorry my english is not good.
hope help you

Shahhussain





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to compile a servlet program????? sushant2002 J2EE 4 December 24th, 2007 06:42 AM
how to compile servlet..... Random Servlets 1 January 16th, 2006 12:28 AM
Compile Louisa VB.NET 2002/2003 Basics 1 November 23rd, 2005 10:14 AM
C# compile biran Visual Studio 2005 1 July 15th, 2005 01:36 PM
How to compile a servlet? wujie J2EE 1 May 13th, 2004 12:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.