5

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?

2
  • Can you please check if below link works for you stackoverflow.com/questions/3049433/… Commented Dec 5, 2013 at 11:46
  • @ABP I cannot find File -> Project Structure -> Platform Settings -> SDKs Re-apply the JSDK home path in Eclipse, where should I look for? Commented Dec 5, 2013 at 11:50

2 Answers 2

4
+50

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>
Sign up to request clarification or add additional context in comments.

2 Comments

Sorry, I cannot understand what .xml is this and where to find it. Anyway you gave me an idea of where to look. I solved adding an external jar from Project->Properties->Java Build Path. Then I used locate rt.jar to know the location of rt.jar. Thanks.
it is maven pom file (maven.apache.org), I assumed you used maven to build project, sorry. but yes, if you do not use maven, the way you did it is an alternative.
0

@HAL - The path is netbeans path. In eclipse(as you are using eclipse) there is same path. Make sure the jre path is selected properly.

In windows Eclipse the path is (Not sure about Linux)

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

There you will get the jre's eclipse is configured with.

Remove them and add them again then refresh the project and check if this works.

1 Comment

I tried to remove them and add them again but it's not working, sorry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.