gpt4 book ai didi

java - 创建 javadoc 时出现 fatal error (无法找到包 java.lang)

转载 作者:搜寻专家 更新时间:2023-10-31 20:12:14 25 4
gpt4 key购买 nike

我正在尝试在 Linux 下使用 Eclipse Kepler 在我的 java 项目中运行 javadoc,但出现此错误:

Constructing Javadoc information...
com.sun.tools.javac.util.FatalError: Fatal Error: Unable to find package java.lang in classpath or bootclasspath
at com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:137)
at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:521)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:454)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:400)
at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:831)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:400)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:782)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:481)
at com.sun.tools.javac.comp.Enter.main(Enter.java:459)
at com.sun.tools.javadoc.JavadocEnter.main(JavadocEnter.java:71)
at com.sun.tools.javadoc.JavadocTool.getRootDocImpl(JavadocTool.java:180)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:364)
at com.sun.tools.javadoc.Start.begin(Start.java:162)
at com.sun.tools.javadoc.Main.execute(Main.java:59)
at com.sun.tools.javadoc.Main.main(Main.java:49)
javadoc: error - fatal error
1 error

我做错了什么?

最佳答案

尝试将 JAVA_HOME/lib/中的 rt.jar 添加到 bootclasspath。例如:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<minmemory>256m</minmemory>
<maxmemory>1024m</maxmemory>
<!-- error fix -->
<bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>

关于java - 创建 javadoc 时出现 fatal error (无法找到包 java.lang),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20272715/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com