Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FatalError while creating javadoc (Unable to find package java.lang)

I'm trying to run javadoc in my java project using Eclipse Kepler under Linux but I'm getting this error:

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

What am I doing wrong?

like image 281
HAL9000 Avatar asked Oct 03 '22 07:10

HAL9000


1 Answers

Try adding rt.jar from JAVA_HOME/lib/ to the bootclasspath. For example :

<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>
like image 154
Saša Šijak Avatar answered Oct 10 '22 03:10

Saša Šijak