[英]package org.apache.commons.io does not exist error
我正在使用 ant 編譯器編譯一個 .java 文件。 我收到以下錯誤“包 org.apache.commons.io 不存在錯誤”
我下載了 apache Commons IO 二進制文件並將 .jar 文件粘貼到“C:\\Program Files\\Java\\jdk1.7.0_51\\lib\\missioncontrol\\plugins”
任何幫助。 我需要修改我的構建 xml 文件的類路徑嗎?
<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)。...我需要覆蓋如下已管理的版本以獲取正確的版本:
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
我也遇到了同樣的問題,但是在 pom 錯誤中添加依賴項后被刪除了。
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
你也可以參考 URL http://zetcode.com/java/fileutils/
前往: http ://commons.apache.org/proper/commons-io/download_io.cgi 下載:commons-io-2.4-bin.zip 解壓並在commons-io-2.4文件夾中找到commons-io-2.4.jar
嘗試在外部添加jar, 這里 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.