common-java-errors

15y, 302d ago [edited]

Class names are only accepted if annotation processing is explicitly requested

Problem

When attempting to compile I get the following error:

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

Solution

You forgot the .java extension on the filename, please type:

javac myfirstjavaprog.java

Comments

We'll email a 6-digit code to verify your comment and notify you of replies.

hide preview ▲show preview ▼
Leave first comment to start a conversation!