| | |
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 |
911 actionlistener addressbook android api append applet application array arrays automation binary block bluetooth character chat class client code component consumer csv database desktop eclipse error fractal ftp game givemetehcodez graphics gui html ide image input integer j2me japplet java javaarraylist javac javaee javaprojects jmf jni jpanel julia linked linux list loop mac map method methods mobile netbeans newbie number objects online oriented panel print printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner screen se server set size sms sort sql string swing template test threads time title tree tutorial-sample ubuntu update windows working






