当我在ant中构建我的build.xml时,我收到以下两条错误消息:snap:

时间:2015-11-09 07:15:41

标签: java eclipse ant build.xml

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. 当我们点击错误的第一个链接时,它会转到粗体和斜体下面的主build.xml:
  2.    <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中的错误:
    2. <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。

      任何人都可以帮我解决这个错误。

1 个答案:

答案 0 :(得分:0)

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