Search code examples
javajakarta-eeapache-commonsapache-commons-fileupload

jars added to WEB-INF/lib doesn't get recognized when I try to import them : says the package doesn't exist


I have added org.apache.commons.fileupload and org.apache.commons.io package into the WEB-INF/lib directory of my project based on google appengine. But when I try importing in the servlet files the compiler/IDE gives an error that this package doesn't exist. Why is that ?

The jar files added :

enter image description here

What can be the reason I am getting this error ? What should I do to solve this problem ?


Solution

  • You might also have to add them to your project's classpath.

    for eclipse:

    Right click the jar, select build path and add it to the build path, then try again.

    for netbeans:

    in the project properties window click libraries in the left panel. In the right panel add it to the compile classpath