| | |
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)
Views: 6073 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Java
3d @param affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth byte c# chat class classes click client code compare component corrupted database detection draw eclipse error event exception file fractal game givemetehcodez graphics gui guitesting helpwithhomework html ide image input integer j2me java java.xls javaprojects jmf jni jpanel julia keytool linux list loop map method methods mobile netbeans newbie number object oracle os pong print problem producer program programming project projectideas read recursion reflection replaysolutions rim scanner screen server set size sms socket sort sql string swing terminal test threads time transfer tree web windows






