Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The "cannot find symbol" error occurs because JFlex generates a new Java file that needs to be compiled before it can be used in the code. To fix this error, follow these steps:

  1. In Intellij, navigate to the project directory where the JFlex file is located.

  2. Open a terminal window or command prompt in this directory.

  3. Type the command "javac" followed by the name of the generated Java file, including the file extension. For example, if your JFlex file is named "test.flex" and the generated Java file is "TestLexer.java", type "javac TestLexer.java" and press Enter.

  4. If the compilation is successful, there should be no output or error messages.

  5. Go back to the Intellij project window and try running the program again. The "cannot find symbol" error should be resolved.