I’m trying to import org.apache.commons.fileupload.* but I am being told that it does not exist.
I am downloading this JAR: http://commons.apache.org/fileupload/
And placing it on the classpath. So what am I doing wrong here?
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.
Most likely you’re thinking of
%CLASSPATH%environment variable. You shouldn’t do that. The JAR file has to go in/WEB-INF/libfolder of the dynamic web application project. That folder is by default covered by the webapp’s classpath. A bit decent IDE (Eclipse, Netbeans, etc) will automagically add it to the Build Path whenever you drop a JAR file in that folder.When you’re compiling using plain vanilla
javac.exein command console, then you have to specify it in the-cpargument.Update:
Assuming that you’re using Windows and are sitting in source root folder, here’s how
javac.exeshould look like:Note: the wildcard only works on JDK 1.6 or newer. Otherwise you’ve to specify all libraries separately.