Friday, January 31, 2014

error: Class names, 'HelloWorld', 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 HelloWorld.java not javac HelloWorld.

Example:
   $ javac HelloWorld
   error: Class names, 'HelloWorld', are only accepted if annotation processing is explicitly requested
   1 error

   $ javac HelloWorld.java

   $ java HelloWorld 
   Hello World

Blog Archive