java - ant编译时找不到jar包的问题
伊谢尔伦
伊谢尔伦 2017-04-17 11:50:35
0
2
444

使用ant编译项目时,输出如下的日志:

    [javac] 警告:[path] 错误的路径元素 "2.1.1.0\lib\jaxb-impl-2.2.5.jar":无此文件或目录
    [javac] 警告:[path] 错误的路径元素 "2.1.1.0\lib\jaxb-impl-2.1.13.jar":无此文件或目录

但是在此目录下存在相应的jaxb-impl.jar包。其他用到的包也是这样的情况,请问该怎么处理呢?

build.xml中编译的ant脚本是这样的:

<target name="compile">
        <mkdir dir="classes" />

        <javac compiler="modern" srcdir="src" destdir="classes" debug="true">
            <compilerarg value="-Xlint"/>
            <classpath refid="classpath"/>
        </javac>

        <javac compiler="modern" srcdir="test" destdir="classes" debug="true">
            <compilerarg value="-Xlint"/>
            <classpath refid="classpath"/>
        </javac>

        <!-- 拷贝源码里面的一些资源文件 -->
        <copy todir="classes">
            <fileset dir="src">
                <exclude name="**/*.java" /> 
                <exclude name="**/.*" /> 
            </fileset>
        </copy>
    </target>
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
Peter_Zhu

When ant compiles, it prompts that a lot of software packages do not exist
Solution:
Put the jar package in the project's lib in the ext directory of jdk's jre
For example, java home is D:JavaEEJavajdk1.8.0_112 directory
You put the jar packages jaxb-impl-2.2.5.jar and jaxb-impl-2.1.13.jar under your project's lib into the D:JavaEEJavajdk1.8.0_112jrelibext directory Just download
and recompile with ant

迷茫

These warnings can be ignored, but it is still unknown where the warnings come from.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template