Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate javadocs for android project

I followed all the instruction given on stackflow, but unfortunately not able to generate doc file for my android project.

If I am not mentioning class path on last step of java doc generation, then getting "Android reference" error.

And if using it, then getting "javadoc: error - The -classpath option may be specified no more than once." error.

Using classpath:

-classpath "D:\Android 4.2 SDK\android_sdk\platforms\android-15\android.jar"

Am I using correct class path command ?

Please help me out.

Environment used: Eclipse indigo

like image 846
androiddeveloper2011 Avatar asked Jun 28 '13 05:06

androiddeveloper2011


3 Answers

If you use Intellij IDEA go to Tools - Generate JavaDoc... Specify all the settings and set params: -bootclasspath [path]\android-sdk\platforms\android-{version}\android.jar -encoding UTF-8 -docencoding utf-8 -charset utf-8

More information is in this post.

like image 85
anil Avatar answered Oct 12 '22 11:10

anil


Have You followed these steps (from www.mtholyoke.edu)? This works on my Project....if not and You get an error, please write here which error You get.

  1. Project -> Generate Javadoc

  2. In the "Javadoc command" field - browse to find javadoc.exe • On the computers in the Clapp CS lab that is C:\JBuilderX\jdk1.4\bin\javadoc.exe • On other computers it would be \bin\javadoc.exe

  3. Check the box next to the project/package/file for which you are creating the javadoc

  4. In the "Destination" field browse to find the desired destination (for example, the root directory of the current project).

  5. Leave everything else as it is.

  6. Click "Finish"

Javadoc should be in the destination folder. Open "index.html"

EDIT

I found a thread here in Stackoverflow with a lot of tipps, try this:

Javadoc in Eclipse failing to recognize packages

NEXT EDIT

It is only a possibility, but You specified Your classpath as:

"D:\Android 4.2 SDK\android_sdk\platforms\android-15\android.jar"

I know that eclipse got some problems with spaces inside a path. So the first part "Android 4.2 SDK" has to be specified without spaces, maybe here is the issue. But be aware, if You change this path, You have to set everywhere the new path where You have definded it.

like image 36
Opiatefuchs Avatar answered Oct 12 '22 10:10

Opiatefuchs


I'm using the command line. I have also updated to Eclipse Kepler. It seems to execute javadoc differently? I'm investigating. But try this:

read the javadoc manual. It's confusing and doesn't tell you what to do, but, here's an example that should get you going.

Create a file called "options"

Add to the file this:

-d target-bin
-stylesheetfile style.css
-use
-splitindex
-windowtitle 'My Project Name Class Specification'
-doctitle 'My Project Name Class Specification'
-header '<b>My Project Name</b><br><font size="-1">0.1.5-alpha</font>'
-bottom 'Copyright 2014 My Company or Myself. All rights reserved.'
-group "Group Of Packages" "com.mypackage.*"
-overview overview.html
-exclude 'android'
-subpackages 'com.mypackage:android'
-charset utf-8
-encoding UTF8
-quiet
-sourcepath ../myProject/src;..\..\..\android-sdks\sources\android-19

Then on the command line type:

javadoc @options

Now, in Kepler, the "Generate Javadoc" dialog box says "What is the javadoc command line"...I suspect I'll have to type something like this. But don't know.

Hopefully this quick example will give you a start on how to get it done for your purposes.

By the way, I created a generic Eclipse project called "javadoc" in my Workspace so I could manage the files.

like image 2
James Barwick Avatar answered Oct 12 '22 10:10

James Barwick