Welcome to Dream.In.Code
Getting Java Help is Easy!

Join 132,638 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,070 people online right now. Registration is fast and FREE... Join Now!




Package javax.servlet not found

 
Reply to this topicStart new topic

Package javax.servlet not found

KYA
post 11 Oct, 2008 - 07:22 AM
Post #1


#include <nerd.h>

Group Icon
Joined: 14 Sep, 2007
Posts: 4,211



Thanked 50 times

Dream Kudos: 1150
My Contributions


I've been working on a model 2 web app for a little while now and I came to the point of testing on the server. However, when I try to compile my servlet I get the error message in the title. I have set my CLASSPATH to C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib where the servlets-api.jar file is located that is supposed to be the reference. I have set and reset this variable and have done a system restart. Any thoughts on what else I might need to do so I can compile the servlet to a .class file and test it on the server?
User is offlineProfile CardPM

Go to the top of the page

>>codingGeek<<
post 11 Oct, 2008 - 08:38 AM
Post #2


New D.I.C Head

*
Joined: 12 Jun, 2008
Posts: 28



Thanked 1 times
My Contributions


Is the javax.servlet in your jdk library? I had this same problem yesterday. It said that it could not find a particular library, so I added the javax library with javax.servlet.http (downloaded from sun) and manually added it to my jdk library then the problem went away.
User is offlineProfile CardPM

Go to the top of the page

KYA
post 11 Oct, 2008 - 09:11 AM
Post #3


#include <nerd.h>

Group Icon
Joined: 14 Sep, 2007
Posts: 4,211



Thanked 50 times

Dream Kudos: 1150
My Contributions


Could you be a little more descriptive of how to do that? I thought I had that library, but I'm open to trying it again.
User is offlineProfile CardPM

Go to the top of the page

>>codingGeek<<
post 11 Oct, 2008 - 10:28 AM
Post #4


New D.I.C Head

*
Joined: 12 Jun, 2008
Posts: 28



Thanked 1 times
My Contributions


From google search for javax.servlet downloads, download the most recent file from Sun website. Extract all the files for that file (should be a javax file folder). Then add that file folder to your Java library, which should be located at C://ProgramFiles/Java/jdk1.6/lib. There may be a javax folder in there already, but just overwrite everything.

I hope that works for you.
User is offlineProfile CardPM

Go to the top of the page

KYA
post 11 Oct, 2008 - 10:48 AM
Post #5


#include <nerd.h>

Group Icon
Joined: 14 Sep, 2007
Posts: 4,211



Thanked 50 times

Dream Kudos: 1150
My Contributions


I downloaded and installed it. I copied the entire contents of the lib folder into my jdk one as well as the javax folder. sad.gif I must be missing something else... Perhaps a reinstall of the jdk is in order.


EDIT: Reinstalling the jdk did not work. weird.

This post has been edited by KYA: 11 Oct, 2008 - 12:16 PM
User is offlineProfile CardPM

Go to the top of the page

KYA
post 12 Oct, 2008 - 08:11 AM
Post #6


#include <nerd.h>

Group Icon
Joined: 14 Sep, 2007
Posts: 4,211



Thanked 50 times

Dream Kudos: 1150
My Contributions


EDIT: I finally found a solution on some obscure thread on a java forum dating back 6 years. i had to copy the jar file in my tomcat folder to the fre extension folder. This is a classic reason of why I can't stand java >:( Thanks for the help all.

This post has been edited by KYA: 12 Oct, 2008 - 01:45 PM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 04:22AM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month