1

I commit code documentation is very essential to maintain the software product. I am using notepad++ to write the java code. I installed one of its plugin NppDocIt that inserts auto comments by pressing ctrl+alt+shift+D. Its good to know about methods but I want to generate code documents like java docs for example This Document

Update-1 Thanks for good guidance and I learned a lot.

I tried to generate javadoc as following:

F:\Java\Tomcat\webapps\ROOT\WEB-INF\classes>javadoc -d "C:/docs" -sourcepath -package "com/i18n/source/i18n" -subpackages com
javadoc: error - Illegal package name: "com/i18n/source/i18n"
1 error

My package resides as:

com
  |--i18n
       |--resources
            |--bundles
                  |--labelsBundle

Please advise where I am wrong?

Update-2
Answer:

  1. I added all java files in one folder
  2. Created one folder for example c:/docs
  3. run this command from commandline javadoc -d "C:/docs" *.java

    and successfully my codes documentation generated

Thanks from the bottom of my heart to stackoverflow and participants of this thread

Ghayel
  • 109
  • 1
  • 3
  • 14
  • 7
    Why on earth do you use notepad++ for programming in a language like Java? You should use an IDE, like Eclipse or Netbeans. These have functions that generate JavaDoc (can also be done from command line with 'javadoc'). Have you tried googling 'how to generate JavaDoc'? – NickL Jan 06 '17 at 21:08
  • 4
    `javadoc` is a tool that scans the java source for comments in order to create the html documentation (like you've linked). if you are already writing valid javadoc style comments, you just need to run the utility: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html – trooper Jan 06 '17 at 21:10
  • 3
    I agree that it might be irrelevant to this question. However, as the OP mentions that code documentation is essential for code maintenance, so is the usage of an IDE. Have fun maintaining (refactoring, debugging) code with a text editor. – NickL Jan 06 '17 at 21:23
  • 3
    Possible duplicate of [How to generate Javadoc from command line](http://stackoverflow.com/questions/4592396/how-to-generate-javadoc-from-command-line) – NickL Jan 06 '17 at 21:25
  • Vote up for javadoc generator tool link – Ghayel Jan 06 '17 at 21:25
  • Vote up for generating docs via command line – Ghayel Jan 06 '17 at 21:28

1 Answers1

0

I found a similar question here: Generic javadoc command that always generates all javadocs in a given tree?

From the answer from user stian,

On Windows you can do it like this:

Generate file list:

dir /s /b *.java > file.lst

Generate javadoc:

javadoc -d outputdir @file.lst

Kirby
  • 15,127
  • 10
  • 89
  • 104