包 org.apache.commons.io 不存在错误 [英] package org.apache.commons.io does not exist error
问题描述
我正在使用 ant 编译器编译一个 .java 文件.我收到以下错误包 org.apache.commons.io 不存在错误"
I am compiling a .java file using ant compiler. I am getting the following errror "package org.apache.commons.io does not exist error"
我下载了 apache Commons IO 二进制文件并将 .jar 文件粘贴到"C:\Program Files\Java\jdk1.7.0_51\lib\missioncontrol\plugins"
I downloaded the apache Commons IO binaries and pasted the .jar files in "C:\Program Files\Java\jdk1.7.0_51\lib\missioncontrol\plugins "
任何帮助.我需要修改我的构建 xml 文件的类路径吗?
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>
推荐答案
我遇到了同样的问题然后意识到获得的 commons-io 版本低于我需要的版本 (2.4)....我需要如下覆盖已管理的版本以获取正确的版本:
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屋!