views:

503

answers:

2

Quoting, Sun's Official Java Tutorial

Class names, 'HelloWorldApp', are only accepted if annotation processing is explicitly requested

What does it mean? And how to apply it?

+5  A: 

"Annotation Processing" is a hook into the compile process of the java compiler, to analyse the source code for user defined annotations and handle then (by producing compiler errors, compiler warning, emmiting source code, byte code ...).

http://java.sun.com/javase/6/docs/api/javax/annotation/processing/package-summary.html

Arne
+2  A: 

From the very next line of the page that you refer to:

Class names, 'HelloWorldApp', are only accepted if annotation processing is explicitly requested

If you receive this error, you forgot to include the .java suffix when compiling the program. Remember, the command is javac HelloWorldApp.java not javac HelloWorldApp.

That is, the string that you are referring to is a possible error that you might get when trying to compile the examples. The very next line in the document, tells you how to resolve the issue.

If you want to know more about annotations, what they are, and how to use them, then I would suggest to go through the Annotations tutorial.

Paul Wagland
Question: "What is annotation processing in Java?"
Daniel Earwicker
@Earwicker: That is the title of the question, now read the text of the question: this page says blah, what does that mean?
Paul Wagland
Yeah, I read it. It doesn't say the OP has hit *any* kind of compile error they can't fix. It says (again) they want to know what annotation processing is.
Daniel Earwicker
@Earwicker: I have updated my answer to answer both interpretations of the question.
Paul Wagland