FatalError when creating javadoc (cannot find java.lang package)

I try to run javadoc in a java project using Eclipse Kepler on Linux, but I get 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?

+4
java eclipse javadoc
Nov 28 '13 at 18:25
source share
2 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> 
+4
Dec 05 '13 at 12:10
source share

@HAL - path - netbeans path. In eclipse (how you use eclipse) the same path exists. Make sure the jre path is selected correctly.

On Windows Eclipse path (not sure about Linux)

windows> preferences> Java (left tree)> Installed JREs

There you will get jre eclipse with customization.

Delete them and add them again, and then update the project and see if this works.

0
Dec 05 '13 at 11:56
source share



All Articles