| | |
Is "javax.servlet" included in Eclipse SDK
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
I'm trying to learn Java Servlets on my own but I'm having some very basic problems.
The code produces a compiler error, "the import javax.servlet cannot be resolved".
I'm using version 3.2.2. Why am I having this problem?
The code
Java Syntax (Toggle Plain Text)
"import javax.servlet.ServletException;"
I'm using version 3.2.2. Why am I having this problem?
Nope by default the Java Plugin for Eclipse only includes Core Java, Servlets are not a part of that.
A short cut to resolve that error would be, in case you have tomcat / some other java enabled server installed, just check in their "lib" folder if you find any jar called "servlet.jar" or "j2ee.jar" or something similar in name and add it to your project's build path in Eclipse, this should solve the compile error.
However you will not be able to test your servlets directly via Eclipse in this case
A short cut to resolve that error would be, in case you have tomcat / some other java enabled server installed, just check in their "lib" folder if you find any jar called "servlet.jar" or "j2ee.jar" or something similar in name and add it to your project's build path in Eclipse, this should solve the compile error.
However you will not be able to test your servlets directly via Eclipse in this case
Last edited by stephen84s; Jun 29th, 2008 at 6:45 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
I'm using Tomcat 5.0.
There are multiple lib folders and none of the jar files match exactly. Which folder should I look into? Even if I choose the right folder how exactly should I add it the built path? I attached the search result of "lib".
What is the other method of installing the servlet package?
There are multiple lib folders and none of the jar files match exactly. Which folder should I look into? Even if I choose the right folder how exactly should I add it the built path? I attached the search result of "lib".
What is the other method of installing the servlet package?
if you are using the latest version of tomcat 6.0+ there is a "lib" folder in the ROOT directory of tomcat, you should find the servlet.jar file there.
In tomcat 5.0 I assume it should be in
In tomcat 5.0 I assume it should be in
$CATALINA_HOME/share/lib The second way is to install the J2EE Standard Tools plugin for eclipse. Last edited by stephen84s; Jun 30th, 2008 at 3:11 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
![]() |
Other Threads in the Java Forum
- Previous Thread: need a bit o help
- Next Thread: Particle System problem (collision detection and handeling)
| Thread Tools | Search this Thread |
2dgraphics account android api apple applet application array arrays automation banking binary binarytree bluetooth chat chatprogramusingobjects class classes client code component data database derby design draw eclipse encryption error event exception fractal game givemetehcodez graphics gui html ide if_statement image inheritance input integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel jtextfield julia linux list loop map method methods midlethttpconnection mobile monitoring netbeans newbie nullpointerexception open-source oracle print printing problem program programming project property recursion reference ria scanner screen search server set size sms sort sourcelabs splash sql static stop string swing testautomation threads time tree ui unicode validation windows






