Android Eclipse:生成javadoc时出现javadoc错误

时间:2014-08-17 16:34:29

标签: java android eclipse javadoc

我没有使用javadoc实用程序的经验。我正在尝试从ADT eclipse为类创建java文档。我已经下载了文档并为下载的文档指定了android.jar的javadoc URL。好像它无法获得android apis的文档

这是我得到的错误。

Loading source file C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java...
Constructing Javadoc information...
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:6: error: package android.content does not exist
import android.content.Context;
                      ^
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:7: error: package android.content does not exist
import android.content.Intent;
                      ^
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:8: error: package android.os does not exist
import android.os.Bundle;
                 ^
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:9: error: package android.os does not exist
import android.os.Parcelable;
                 ^
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:10: error: package android.view does not exist
import android.view.LayoutInflater;
                   ^
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:11: error: package android.view does not exist
import android.view.Menu;
                   ^
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:12: error: package android.view does not exist
import android.view.MenuItem;
                   ^
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:13: error: package android.view does not exist
import android.view.View;
                   ^
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:23: error: cannot access ViewGroup
public class AppTutorial extends ActionBarActivity {
       ^
  class file for android.view.ViewGroup not found
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:26: error: cannot find symbol
    protected void onCreate(Bundle savedInstanceState) {
                            ^
  symbol:   class Bundle
  location: class AppTutorial
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:39: error: cannot find symbol
    public boolean onCreateOptionsMenu(Menu menu) {
                                       ^
  symbol:   class Menu
  location: class AppTutorial
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:50: error: cannot find symbol
        public boolean onOptionsItemSelected(MenuItem item) {
                                             ^
  symbol:   class MenuItem
  location: class AppTutorial
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:66: error: cannot access Activity
    class CustomPagerAdapter extends PagerAdapter {
    ^
  class file for android.app.Activity not found
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:68: error: cannot find symbol
        public Object instantiateItem(View collection, int position) {
                                      ^
  symbol:   class View
  location: class AppTutorial.CustomPagerAdapter
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:107: error: cannot find symbol
        public void destroyItem(View arg0, int arg1, Object arg2) {
                                ^
  symbol:   class View
  location: class AppTutorial.CustomPagerAdapter
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:114: error: cannot find symbol
        public boolean isViewFromObject(View arg0, Object arg1) {
                                        ^
  symbol:   class View
  location: class AppTutorial.CustomPagerAdapter
C:\Users\Abhishek\Documents\GitHub\Mobile-applications\Learn from Map\App\LearnFromMap\src\org\buildmlearn\learnfrommap\AppTutorial.java:120: error: cannot find symbol
        public Parcelable saveState() {
               ^
  symbol:   class Parcelable
  location: class AppTutorial.CustomPagerAdapter
javadoc: warning - Error fetching URL: file:/E:/GSoC/adt-bundle-windows-x86_64-20140321/sdk/docs/package-list
Standard Doclet version 1.7.0_45
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:459)
    at com.sun.tools.doclets.internal.toolkit.util.Util.getAllInterfaces(Util.java:497)
    at com.sun.tools.doclets.internal.toolkit.util.ClassTree.processType(ClassTree.java:194)
    at com.sun.tools.doclets.internal.toolkit.util.ClassTree.buildTree(ClassTree.java:146)
    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:606)
    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)
18 warnings

1 个答案:

答案 0 :(得分:0)

你可以在这里找到答案:

Javadoc in Eclipse failing to recognize packages

在VM选项中添加 -bootclasspath 选项可以解决问题。