I am having a problem while compiling my project in Eclipse. It is showing the error The import org.apache.commons cannot be resolved.

Please tell me what does this error means and how to solve it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The mentioned package/classes are not present in the compiletime classpath. Basically, Java has no idea what you’re talking about when you say to import this and that. It can’t find them in the classpath.
It’s part of Apache Commons FileUpload. Just download the JAR and drop it in
/WEB-INF/libfolder of the webapp project and this error should disappear. Don’t forget to do the same for Apache Commons IO, that’s where FileUpload depends on, otherwise you will get the same problem during runtime.Unrelated to the concrete problem, I see that you’re using Tomcat 7, which is a Servlet 3.0 compatible container. Do you know that you can just use the new
request.getPart()method to obtain the uploaded file without the need for the whole Commons FileUpload stuff? Just add@MultipartConfigannotation to the servlet class so that you can use it. See also How to upload files to server using JSP/Servlet?