Search code examples
javaeclipsenullpointerexceptionjavadoc

Eclipse - Generate JavaDoc - NullPointerException


I haven't generated JavaDocs for the Android project I've been working on for about a month. I just tried, and I'm getting the following output (with no output to my output directory):

Building tree for all the packages and classes...
java.lang.NullPointerException
    at com.sun.tools.javadoc.TypeMaker.getType(TypeMaker.java:83)
    at com.sun.tools.javadoc.TypeMaker.getType(TypeMaker.java:44)
    at com.sun.tools.javadoc.ClassDocImpl.superclassType(ClassDocImpl.java:496)
    at com.sun.tools.doclets.internal.toolkit.util.Util.getAllInterfaces(Util.java:447)
    at com.sun.tools.doclets.internal.toolkit.util.Util.getAllInterfaces(Util.java:485)
    at com.sun.tools.doclets.internal.toolkit.util.ClassTree.processType(ClassTree.java:184)
    at com.sun.tools.doclets.internal.toolkit.util.ClassTree.buildTree(ClassTree.java:136)
    at com.sun.tools.doclets.internal.toolkit.util.ClassTree.<init>(ClassTree.java:91)
    at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:123)
    at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:83)
    at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:63)
    at com.sun.tools.doclets.standard.Standard.start(Standard.java:39)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280)
    at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160)
    at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397)
    at com.sun.tools.javadoc.Start.begin(Start.java:167)
    at com.sun.tools.javadoc.Main.execute(Main.java:59)
    at com.sun.tools.javadoc.Main.main(Main.java:49)
2016 warnings

I'm building the docs at the project level (Android), and am include ActionBarSherlock and Facebook's Android project. Regardless of if I include them though, the documentation still fails.

I'm attempting to run this in Eclipse Java EE IDE for Web Developers, Indigo, Build 20120216-1857

The JavaDoc command is:

/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/javadoc

Playing with the configuration a bit, and I'm getting the following error:

full/path/BaseModelListAdapter.java:147: error: unmappable character for encoding ASCII * @param parent?

The line which is:

* @param parentß

Removing that line removes one of the errors, but I'm still getting weird ones, like the inability to find the base Android packages:

/full/path/CompositeCategoryAdapter.java:7: error: package android.view does not exist import android.view.View; ^

And symbol errors:

BaseModelListAdapter.java:420: error: cannot find symbol
public static BaseModelItemRowViewHolder createInstance( View v )
                                                         ^
symbol:   class View
location: class BaseModelItemRowViewHolder

Solution

  • You probably need to run:

    javadoc -encoding utf-8
    

    Alternatively, you can just use Unicode escapes (e.g. \u0000) instead of including Unicode characters directly.

    Possibly related question: Unicode in javadoc and comments?