简体   繁体   English

适用于Android的Javadoc生成

[英]Javadoc generation for Android

I am trying to generate my documentation for my android project with javadoc. 我正在尝试使用javadoc为我的android项目生成文档。 The problem is that javadoc isn't able to find the android package. 问题是javadoc无法找到android包。 My error is the same as this one. 我的错误与相同。 If I am trying the first solution it says: 如果我尝试第一个解决方案,它会显示:

javadoc: error - The -classpath option may be specified no more than once. javadoc:错误-不能多次指定-classpath选项。

What am I doing wrong? 我究竟做错了什么?

Furthermore, I tried this solution, but I dont know what I have to do at the last step. 此外,我尝试了解决方案,但是我不知道在最后一步必须做什么。

我发现您可以将多个路径添加到-classpath,方法是使用分号将它们分开,并将整个路径括在引号中(如果路径中有空格)

-classpath ".;c:\full\path\to\another\codebase\java;C:\path\to\android.jar"

Okay, I solved the problem with this solution. 好的,我使用解决方案解决了问题。 All I needed to do is to install Cygwin . 我需要做的就是安装Cygwin After it was installed, I needed to install ANT on Cygwin like this . 安装之后,我需要像这样在Cygwin上安装ANT Afterwards, I had to configure java in Cygwin. 之后,我必须在Cygwin中配置Java

And now a new detail for me(maybe the reason why the -classpath command didn't worked for me in the third step of Generate Javadoc in Eclipse). 现在为我提供了一个新的详细信息(也许是-classpath命令在Eclipse中生成Javadoc的第三步中对我不起作用的原因)。 I had to open the javadoc.xml and saw this line: 我不得不打开javadoc.xml并看到以下行:

<javadoc [...] additionalparam="-classpath C:\Progra~2\Android\android-sdk\platforms\android-10\android.jar" classpath="C:\Program Files (x86)\Android\android-sdk\tools\support\annotations.jar" [...]/>

The additionalparam is my own of the third step of Generate Javadoc. 另外的参数是我自己的Generate Javadoc第三步。 I took that path and put it into the classpath="" ... That's it. 我采用了该路径并将其放入classpath =“” ...就是这样。 Maybe someone could say how to configure the classpath in Eclipse manually, because I couldn't find something. 也许有人会说如何在Eclipse中手动配置类路径,因为我找不到任何东西。

Allright, now switched to the folder of the javadoc.sh and run that file with sh javadoc.sh 好的,现在切换到javadoc.sh的文件夹,并使用sh javadoc.sh运行该文件sh javadoc.sh

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM