簡體   English   中英

eclipse Ant Build軟件包不存在

[英]eclipse Ant Build package does not exist

我正在嘗試在eclipse中生成一個.jar (以Ant Build的身份運行),但我收到了關於我添加的Apache jar的錯誤消息:

[javac] *path...*: error: package org.apache.commons.io does not exist
[javac] import org.apache.commons.io.FilenameUtils;

這些jar是從BuildPath -> Add External Jar

我錯過任何一步了嗎?

您需要在build.xml中配置編譯路徑,可以像這樣完成

<path id="main.classpath">
  <fileset dir="<directory with your jar dependencies>">
     <include name="*.jar"/>
  </fileset>

然后將指向該路徑的鏈接添加到您的javac任務中

<javac destdir="<directory where to store class files>" srcdir="<directory with java files>" debug="on" compiler="modern">
     <classpath refid="main.classpath"/> <!-- this is where you tell javac which path to use -->
</javac>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM