aspose file tools*
The moose likes Servlets and the fly likes i cant run my program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "i cant run my program" Watch "i cant run my program" New topic
Author

i cant run my program

nana Amr
Ranch Hand

Joined: May 18, 2005
Posts: 53
hi all i have this program:


but when i compile it the error :


plz what should i do ???
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You need to get the javax.servlet libraries on to your compiler's classpath.

If you're using Tomcat, add TOMCAT_HOME/common/lib/servlet-api.jar to the classpath.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
nana Amr
Ranch Hand

Joined: May 18, 2005
Posts: 53
but i have servlat lib at
C:\tomcat\jakarta-tomcat-3.2.3\lib\servlet.jar
isnt ok??
nana Amr
Ranch Hand

Joined: May 18, 2005
Posts: 53
plz tell me how to add it in steps
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Add servlet.jar to your system's CLASSPATH environment variable or use javac's -cp switch to add it.

By the way:
Why are you using such an ancient version of Tocmat?
[ October 22, 2005: Message edited by: Ben Souther ]
nana Amr
Ranch Hand

Joined: May 18, 2005
Posts: 53
so :
set TOMCAT_HOME=C:\tomcat\jakarta-tomcat-3.2.3\lib\servlet.jar
??
nana Amr
Ranch Hand

Joined: May 18, 2005
Posts: 53
Originally posted by Ben Souther:
By the way:
Why are you using such an ancient version of Tocmat?

hehehehehe

i dont know, its what i have in my country
[ October 22, 2005: Message edited by: nana Amr ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

See:
http://faq.javaranch.com/view?HowToSetTheClasspath

If you're not familiar with Java, I strongly recommend either getting a book on it or following some web tutorials to strengthen up on the fundamentals before tackling servlets.
You'll save yourself a lot of time and aggravation if you do;

There is no shortage of them on the web:
http://www.google.com/search?hl=en&q=JAVA+TUTORIAL&btnG=Google+Search
nana Amr
Ranch Hand

Joined: May 18, 2005
Posts: 53
OK THX FOR HELP
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by nana Amr:

hehehehehe

i dont know, its what i have in my country

[ October 22, 2005: Message edited by: nana Amr ]


Are you unable to download more recent versions from:
http://tomcat.apache.org ?

The problem with starting out on Tomcat 3.3 is that most of the current books and tutorials are written for more recent versions of, the Servlet Spec, the JSP spec, and for Tomcat in general. A lot of the projects in the books and tutorials won't work with that version.
Additionally, most of the people on forums like this haven't touched 3.3 in years (if at all) and may only be able to give you advice that doesn't really apply to the version you are running.
nana Amr
Ranch Hand

Joined: May 18, 2005
Posts: 53
im try to learn servlet and jsp from a book "advanced java 2 platform" by Deitel, and the CD come with it includes j2sdk 1.3.1 and tomcat 3.2.3.
im trying to learn more but this what i have
nana Amr
Ranch Hand

Joined: May 18, 2005
Posts: 53
i dont know if the book examples work with the new tomcat version
nana Amr
Ranch Hand

Joined: May 18, 2005
Posts: 53
and thx u solv my problem
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i cant run my program