【问题标题】:ant file build failed due to below errors由于以下错误,ant 文件构建失败
【发布时间】:2012-05-21 09:20:13
【问题描述】:

当我尝试运行 ant 文件时,构建将失败,原因如下:

[projectBuild] null DN Jaxb Beans:Multiple output locations are disabled, cannot associate entry: 'DN Jaxb Beans/src' with a specific output.
[projectBuild] null DN Jaxb Beans:Unbound classpath container: 'JRE System Library [J2SE-1.5]'.
[projectBuild] null DN Jaxb Beans:Unbound classpath container: 'org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER'.
[projectBuild] null DN Jaxb Beans:Multiple output locations are disabled, cannot associate entry: 'DN Jaxb Beans/src' with a specific output.
[projectBuild] null DN Jaxb Beans:The project was not built since its classpath is incomplete. Cannot find the class file for java.lang.Object. Fix the classpath then try rebuilding this project.
[projectBuild] 1 JAXBVersion.java:This compilation unit indirectly references the missing type java.lang.Object (typically some required class file is referencing a type outside the classpath)
[projectBuild] Errors were detected after building DN Jaxb Beans
[projectBuild] ProjectBuild: DN Jaxb Beans Exception=Errors were detected after building DN Jaxb Beans
[projectBuild] BUILD FAILED: file:C:/workspace.May21/DN Ant Scripts/buildDev.xml:149: 

ProjectBuild: DN Jaxb Beans Exception=Errors were detected after building DN Jaxb Beans
Total time: 19 minutes 4 seconds

你能解决这个问题吗?

【问题讨论】:

    标签: java ant build


    【解决方案1】:

    以下错误是一个很好的指示:

    Cannot find the class file for java.lang.Object
    

    如果 java 找不到 java.lang.Object,那么您的 java 安装存在配置问题。消息JRE System Library [J2SE-1.5] 看起来像一个eclipse jre 配置名称,所以我假设您正在通过eclipse 运行它。我会尝试在 eclipse 的执行环境配置中删除并重新添加。

    【讨论】:

    • 我在 WebSphere Application Developer 中运行。已配置 Java 1.4。
    • 您的项目似乎是为 java 1.5 配置的。检查您的项目设置以查看它正在寻找的 java 版本和您的工作区设置以查看您可用的 java 版本。
    • 我再次配置了首选项并以正确的方式进行了设置。然后它正确启动了。
    猜你喜欢
    • 2012-08-13
    • 2020-01-16
    • 2022-11-02
    • 2019-10-15
    • 1970-01-01
    • 2011-06-29
    • 1970-01-01
    • 2021-07-02
    • 2018-10-07
    相关资源
    最近更新 更多