• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

package javax.servlet.* not found  RSS feed

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,

I have installed java 7 on my machine. However, when i try to compile any servlet it is not able to locate any of the packages relating to servlets i.e. javax.servlet.* and javax.servlet.http.*.

I surfed the net and found that I need to have jsdk.jar. However, despite rummaging the net for an entire week, I could not find jsdk.jar. I was also directed to a page which says that I should download the servlet development kit, but the links provided in most of the pages on the net are old and redirect me to the oracle sun site, which does not have any such development kit. Now, it has become a nightmare for me to compile even a trifle servlet.

Kindly help,
Thanks in anticipation.

Anand.
 
Greenhorn
Posts: 26
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add servletconfig.jar in your class-path.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Servlet API is not included in JDK ,I did it by installing tomcat and by then added path C:\Program Files\Java\Tomcat 7.0\lib\servlet-api.jar to the classpath environment variable.
 
Ranch Hand
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you said, servlet-api.jar needs to be added in the class path. Just try out these options.
1) If you are running from cmd prompt, close and open a new window to compile. Since it may be resulting to the old one.
2) print and check the class path in cmd prompt
3) Try to remove spaces in the class path.
 
Saloon Keeper
Posts: 4693
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jsdk.jar, and the servlet development kit, have ceased to exist years ago. What you read must have been obsolete for a loooong time.

Add servletconfig.jar in your class-path.


No such thing exists.

As kumar said, the easiest is to download a servlet container (like Tomcat); it has everything you need.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!