Solve the Java “syntax error on token enum” problem


Enum is a Java reserved keyword, and in Java 1.4 and prior versions, warninig may be prompted at compile time to indicate that enum is a keyword and is not recommended. However, since Java version 1.5 an error will be reported: Syntax Error on token enum

You can rename a variable named enum.
If it is inconvenient to modify, such as the old code can not work, this can be solved as follows.

The project is then rebuilt. If the syntax error on token enum error is also reported, the project is deleted from the workspace, then re-imported and rebuilt.

Read More: