| | |
Is "javax.servlet" included in Eclipse SDK
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 |
3d 6 @param affinetransform android api applet application arc array arrays automation binary bluetooth bold byte c++ chat class client code color compare component coordinates database detection doctype eclipse eclipsedevelopment educational error file fractal froglogic game givemetehcodez graphics gridlayout gui guitesting helpwithhomework html ide ideas image ingres input integer internet intersect j2me java java.xls javaexcel javaprojects jni jpanel jtextarea julia keytool keyword linux list map method methods mobile netbeans newbie nextline object pong problem producer program programming project projectideas read recursion recursive replaysolutions rim scanner sell server set size sms sort sql string swing terminal threads tree web websites windows






