【问题标题】:When I am building my build.xml in ant I am getting two error messages below is snap:当我在 ant 中构建 build.xml 时,我收到以下两条错误消息:
【发布时间】:2016-02-09 19:17:20
【问题描述】:
BUILD FAILED
C:\Users\workspace\Cq\build.xml:157: The following error occurred while executing this line:
C:\Users\workspace\Cq\CqClient\build.xml:155: Compile failed; see the compiler error output for details.

Total time: 40 seconds
  1. 当我们点击第一个错误链接时,它会转到粗斜体行下方的 main build.xml:
   <target name="build" description="Builds components necessary for CqServer" depends="prepare">
      <ant antfile="build.xml" dir="${build.home.dir}/MCD_JavaClient" target="jar" inheritAll="true"/>
      <!--<ant antfile="build.xml" dir="${cqserver.dir}" target="jar" inheritAll="true"/>
      <ant antfile="build.xml" dir="${cqclient.dir}" target="war" inheritAll="true"/>-->
      <ant dir="${cqserver.dir}" inheritAll="false"/>
      ***<ant dir="${cqclient.dir}" inheritAll="false"/>***on this line it shows error
   </target>
  1. 当我点击第二个链接时,它会在客户端的 build.xml 中显示错误:
<javac srcdir="${base.src}" debug="${debug}" deprecation="${deprecation}" destdir="${build.classes}"> 
            <classpath refid="classpath.base" /> 
</javac>

错误日志:

[javac] C:\Users\workspace\Cq\CqClient\src\com\cq\j2ee\actions\AutoAction.java:20: error: cannot find symbol
[javac] import com.cq.j2ee.util.Constants;
[javac]                              ^
[javac]   symbol:   class Constants
[javac]   location: package com.cq.j2ee.util
[javac] C:\Users\workspace\Cq\CqClient\src\com\cq\j2ee\actions\AutoAction.java:21: error: package com.cq.j2ee.ejb does not exist
[javac] import com.cq.j2ee.ejb.*;
[javac] ^
[javac] C:\Users\workspace\Cq\CqClient\src\com\cq\j2ee\actions\AutoAction.java:22: error: package com.cq.j2ee.msg does not exist
[javac] import com.cq.j2ee.msg.*;
[javac] ^
[javac] C:\Users\workspace\Cq\CqClient\src\com\cq\j2ee\actions\AutoAction.java:47: error: cannot find symbol
[javac]     private CqRemote cqRemote = null;
[javac]             ^
[javac]   symbol:   class CqRemote
[javac]   location: class AutoAction

[javac] C:\Users\workspace\Cq\CqClient\src\com\cq\j2ee\actions\BulkUploadAction.java:31: error: cannot find symbol
[javac] import com.cq.j2ee.util.DtConverter;
[javac]                              ^
[javac]   symbol:   class DtConverter
[javac]   location: package com.cq.j2ee.util
[javac] C:\Users\workspace\Cq\CqClient\src\com\cq\j2ee\actions\BulkUploadAction.java:32: error: package com.cq.j2ee.vo does not exist
[javac] import com.cq.j2ee.vo.*;
[javac] ^
[javac] C:\Users\workspace\Cq\CqClient\src\com\cq\j2ee\actions\BulkUploadAction.java:33: error: package com.cq.j2ee.ejb does not exist
[javac] import com.cq.j2ee.ejb.*;

我还在系统属性中设置我的路径变量指向我的 jdk 的 bin,我已经将我的 JAVA_HOME 设置为 C:\Program file\Java\JDK1.7.0_51。

谁能帮我解决这个错误。

【问题讨论】:

  • “谁能帮我解决这个错误。” - 除非你向我们展示编译器错误!
  • 我添加了错误日志,请查看

标签: java eclipse ant build.xml


【解决方案1】:

看起来您的 CqClient 没有看到您的某些类/包。如果它们在不同的项目中,请尝试在 CqClient 项目中添加适当的依赖项。怎么做 ?我正在使用 Netbeans,在这个 IDE 中,我必须显示项目的属性,然后转到库,在编译部分选择“添加项目”或“添加库”,然后选择项目或库(jar 文件),其中包含的类/包你需要

【讨论】:

    猜你喜欢
    • 2021-10-12
    • 1970-01-01
    • 1970-01-01
    • 2020-06-12
    • 1970-01-01
    • 2018-05-23
    • 2023-02-07
    • 1970-01-01
    • 2019-01-01
    相关资源
    最近更新 更多