how to generate javadocs from command line which produces like HTML page

gudii9
gudii9 used Ask the Experts™
on
Hi,

I would like to know
how to generate javadocs from command line which produces like HTML page for all selected java files similar to pages in sun website. Any links ideas, resources, sample code highly appreciated. Thanks in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
You need to run the javadoc command

http://bazaar.sis.pitt.edu/jdtutorial/index.html
Mick BarryJava Developer
Top Expert 2010

Commented:
use ant, makes it nice and easy

http://ant.apache.org/manual/CoreTasks/javadoc.html

Author

Commented:
what is the command i have to give in command prompt to generate the javadoc. do i need to go to physical location of that file say C://xyz.java then give the command. Please advise
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Java Developer
Top Expert 2010
Commented:
can be as simple as :

javadoc c:\xyz.java

but are lots of options to adjust what you want, which is why ant is typically used to save you rememberinf and typing a long command line

Author

Commented:
when i say
javadoc c:\xyz.java
from command prompt

it says javadoc is not recognized as internal or external command, operable program or batch file...do i need to download something or st some class path etc. please advise
Mick BarryJava Developer
Top Expert 2010
Commented:
add need to add the java bin directory to your path if you want to run it from command line

Author

Commented:
i see under
My Computer--> properties---> advanced---> environmental variables---system variables
C:j2sdk1.4.2_19/bin is missing . Once I add that javadoc showed up fine

Author

Commented:
now it generated the corresponding html etc file. How to find location where it generated those html etc  javadoc files
Mick BarryJava Developer
Top Expert 2010

Commented:
by default they are generated in current directory. that can be changed using -d option

Author

Commented:
it created the files as in screenshot with different names though...and also when i generate for second .java file first .java file corresponding javadoc files are getting overridden. Please advise
javadoc-created.JPG

Author

Commented:
i am not sure which html file i have to choose out of all created ones with irrelevent names.Please advise
Mick BarryJava Developer
Top Expert 2010

Commented:
you should generate them all at once
and open index.html

Author

Commented:
thank you very much
Mick BarryJava Developer
Top Expert 2010

Commented:
no worries, let me know if you need further help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial