Eclipse - 生成JavaDoc - NullPointerException

时间:2012-07-03 15:49:19

标签: java eclipse nullpointerexception javadoc

我没有为我已经工作了大约一个月的Android项目生成JavaDocs。我刚试过,我得到以下输出(没有输出到我的输出目录):

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

我正在项目级别(Android)构建文档,并且包括ActionBarSherlock和Facebook的Android项目。无论我是否包含它们,文档仍然失败。

我正在尝试在Eclipse Java EE IDE for Web Developers中运行它,Indigo,Build 20120216-1857

JavaDoc命令是:

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

稍微使用配置,我收到以下错误:

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

该行是:

* @param parentß

删除该行会删除其中一个错误,但我仍然会变得很奇怪,比如无法找到基本的Android包:

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

符号错误:

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

1 个答案:

答案 0 :(得分:3)

您可能需要运行:

javadoc -encoding utf-8

或者,您可以使用Unicode转义(例如\u0000)而不是直接包含Unicode字符。

可能相关的问题:Unicode in javadoc and comments?