• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error: No public or protected classes found to documents 1 error  RSS feed

 
Frank Thuring
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear experts,
I have a problem. I try to understand an exercise in the book head first java.



then I get the error:

D:\Java\bin>javadoc MultiFor.java
Loading source file MultiFor.java...
Constructing Javadoc information...
javadoc: error - No public or protected classes found to document.
1 error

Can someone tell me what I am doing wrong. The code is from the book. I think the code is not quit good....see underlined
I work under windows with the command prompt, I cannot solve this problem....







[HENRY: Fixed code tags]
 
Frank Thuring
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've changed class MultiFor in public class MultiFor but it still goes wrong.....

I still get the error:
javadoc: error - No public or protected classes found to document

 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was able to reproduce your error and then tried making the class public as you suggested and the javadoc successfully ran. Here's the code that worked for me:
 
Priety Sharma
Ranch Hand
Posts: 156
Android Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you simply try compiling the code with javac the compiler, even without making the class public it works.
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For what it's worth, I also changed your code to remove the compiler error:should be:(Lower case 'y')
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you just want to compile the class, or do you want to generate Javadoc documentation?

To compile the class, use javac, not javadoc.

To generate documentation for your class, you first have to put Javadoc comments in your source code and then run the javadoc tool on it. Your source code doesn't have any Javadoc comments.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Javadoc's default accessibility level is protected. You can use the -package or -private flag to extend visibility.
 
Frank Thuring
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you that was the solution

I had to compile with javac.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!