'package org.apache.commons.io does not exist error

I am compiling a .java file using ant compiler. I am getting the following errror "package org.apache.commons.io does not exist error"

I downloaded the apache Commons IO binaries and pasted the .jar files in "C:\Program Files\Java\jdk1.7.0_51\lib\missioncontrol\plugins "

Any help. Do I need to modify the classpath of my build xml file?

<target name="compile" description="Compile source code">
<mkdir dir="${build.dir}/classes"/>
 <javac includeantruntime="false"
    srcdir="src"
       destdir="${build.dir}/classes"
       classpathref="classpath"
       encoding="UTF8"
       debug="on"
       deprecation="on">
  <include name="**/*.java"/>
  <exclude name="**/NutchExample.java"/>
 </javac>

 <copy todir="${build.dir}/classes/lia/tools">
   <fileset dir="src/lia/tools" excludes="**/*.java"/>
 </copy>
</target>


Solution 1:[1]

I was having same issue then realized that the version of commons-io getting picked up was lower than what I need (2.4)....I need to Override the already managed version as below to get the right one picked up:

<dependency>
     <groupId>commons-io</groupId>
     <artifactId>commons-io</artifactId>
     <version>2.4</version>
 </dependency>

Solution 2:[2]

I also faced the same issue, but after adding dependency in pom error got removed.

<dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>2.6</version>
</dependency>

you can also refer URL http://zetcode.com/java/fileutils/

Solution 3:[3]

Go to: http://commons.apache.org/proper/commons-io/download_io.cgi Download: commons-io-2.4-bin.zip Unzip and find commons-io-2.4.jar in folder commons-io-2.4

Solution 4:[4]

Adding dependency commons-io 2.6.0 solves the problem.

Dependency can be traced by maven dependency plugin : 2.2(spring-cloud-openfeign-core[2.0.2.RELEASE] => feign-form-spring[3.3.0] => commons-fileupload[1.3.3] => commons-io) and the version is 2.6.0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 puppyDomminatedWorld
Solution 2 Brijesh Yadav
Solution 3 orientchen1978
Solution 4 Dileep