包org.apache.commons.io不存在错误 [英] package org.apache.commons.io does not exist error

查看:9673
本文介绍了包org.apache.commons.io不存在错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编译使用ant的编译一个.java文件。我正在以下errror
包org.apache.commons.io不存在错误

我下载了Apache下议院IO二进制文件和粘贴的.jar文件
C:\\ Program Files文件\\的Java \\ jdk1.7.0_51 \\ lib目录\\ missioncontrol \\插件

任何帮助。我是否需要修改我的生成的XML文件的classpath?

 <目标名称=编译描述=编译源$ C ​​$ C>
< MKDIR DIR =$ {} build.dir /班/>
 < javac的includeantruntime =假
    SRCDIR =SRC
       DESTDIR =$ {} build.dir /班
       classpathref =类路径
       编码=UTF8
       调试=上
       德precation =上>
  <包括姓名=** / * java的。/>
  <排除NAME =** / NutchExample.java/>
 < / javac的> <副本todir =$ {} build.dir /班/ LIA /工具>
   <** / * Java的文件集DIR =SRC / LIA /工具排除= />
 < /复制>
< /目标与GT;


解决方案

我有同样的问题,后来意识到公地IO的版本越来越拿起比我需要(2.4)要低....我需要覆盖下面已经托管版本,以获得正确的回升:

 <&依赖性GT;
     <&的groupId GT;公共-IO< /的groupId>
     <&的artifactId GT;公共-IO< / artifactId的>
     <&版GT; 2.4< /版本>
 < /依赖性>

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>

解决方案

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>

这篇关于包org.apache.commons.io不存在错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆