Friday, April 29, 2022

eclipse: maven: Error: Could not find or load main class antlr.debug.misc.ASTFrame

 


>PROBLEM


Attempt to run an Eclipse project returns the following error:


  Error: Could not find or load main class antlr.debug.misc.ASTFrame

  Caused by: java.lang.ClassNotFoundException: antlr.debug.misc.ASTFrame


>SOLUTION

NOTE:
If you are quite sure about your project configuration, try to go straight to the 6th step.


0. Pre-requisite: make sure your pom.xml configuration is correct.


1. On Eclipse, using the Project Explorer (or Navigator), delete the following configuration files:

  .settings

  .classpath




2. Eclipse will complaing throwing an error pop-up. Ignore closing it.


3. Using the Project Explorer (or Navigator), point to the project's root and save it again.

This will generate again the deleted files.


4. Check if there are errors and fix them.




5. Clean the project (menu, Project, Clean...).



Wait to finish. Pay attention on the bottom bar.




6.  Fix the the Eclipse's configuration to run the application.





7. Run the application again and choose the proper option for the project.
In this case is Spring Boot.




8.  Configuration fixed and application is up and running.





>ENV

maven

eclipse

java17


No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...