• Post Reply Bookmark Topic Watch Topic
  • New Topic

error:package javax.servlet does not exists  RSS feed

 
anubha goel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am new to java.i was trying to compile a simple HelloWorld servlet program.but i came across errors indicating package javax.servlet and javax.servlet.http does not exists...i am using jdk1.5.0_09 and tomcat 5.5.23.
i have set all environmental variables:

CLASSPATH-- C:\jdk1.5.0_09\lib\*.jar;.;
PATH-- C:\jdk1.5.0_09\bin
JAVA_HOME--C:\jdk1.5.0_09

please help me out...

Thanks in advance
Anubha
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

CLASSPATH-- C:\jdk1.5.0_09\lib\*.jar;.;


This will not work. You need to list jar files individually in the CLASSPATH - the "*" notation is not recognized. But in your case it should be sufficient to just put the servlet.jar file (or whatever it's called) into the classpath.
 
saurav sarkar
Ranch Hand
Posts: 180
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Else you can go with an IDE like Eclipse and have the necessary
jar files included.
But for beginners its always better to do manual compile
and as Ulf said servlets.jar will do the thing for you.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With Tomcat, the library you need to add to your classpath is servlet-api.jar.

You can find it in: TOMCAT_INSTALL/common/lib/
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!