0

我正在尝试为我的项目编写 ant 脚本,但在 javac 我遇到了这个问题:

80: package com.sun.xml.internal.fastinfoset.util does not exist
[javac] import com.sun.xml.internal.fastinfoset.util.StringArray;
[javac]                                        ^

JAVA_HOME 设置为 jdk1.6 ANT_HOME 设置为 apache-ant-1.8.4

构建文件是

<?xml version="1.0" ?>
<project name="project" default="war">
<property name="location" location="D:\Project"></property>
<property name="project-location" location="${location}\project"></property>
<path id="Web App Libraries.libraryclasspath">
 <fileset dir="${project-location}/web/WEB-INF/lib"/>
 </path>
    <path id="EAR Libraries.libraryclasspath"/>
    <path id="compile.classpath">
        <pathelement location="${project-location}/web/WEB-INF/classes"/>
        <path refid="Web App Libraries.libraryclasspath"/>
        <path refid="EAR Libraries.libraryclasspath"/>
</path>
<path id="Server Library [JBoss v4.2] (unbound).libraryclasspath"/>

<target name="init" >
    <mkdir dir="D:/JBOSSHOME/build/classes"/>
    <mkdir dir="D:/JBOSSHOME/dist" />
</target>

<target name="compile" depends="init" >
    <javac destdir="D:/JBOSSHOME/build/classes" debug="true"       srcdir="${project-location}/src">
        <classpath refid="compile.classpath"/>
    </javac>
</target>


<target name="war" depends="compile">
    <war destfile="D:/JBOSSHOME/project.war" webxml="${project-location}/web/WEB-INF/web.xml">
        <fileset dir="${project-location}/web"/>
        <lib dir="${project-location}/web/WEB-INF/lib"/>
        <classes dir="D:/JBOSSHOME/build/classes"/>
    </war>
</target>

任何帮助或指针将不胜感激!

4

1 回答 1

2

不推荐使用 com.sun.internal 包,因为

  • 不保证它们可以跨环境使用
  • 也不保证对这些类的支持
于 2013-01-29T10:36:29.927 回答