Using Error: Class Names and YourClassName

Using error: Class names, 'YourClassName', is only accepted if annotation processing is explicitly requested.

There are likely instances that you have come across this error and found it very difficult to understand what is happening.

Even experienced engineers face such issues and are unable to move on. This sometimes happens when you are not using your IDE for work.

The reason why this error occurs is really simple.

The reason is that you are trying to use the javac command with a file name without the java extension.

For example:

javac YourClassName - This command will result in the above error. By mistake, you have used javac to execute.

Correct way of using the commands:

-----------------------------------------------------------javac - This is the correct way of using this command to compile. java YourClassName - This is the correct way of using this commad to execute.
Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: