-1

I am getting the error in Eclipse that a Class "cannot be resolved to a type" (exact error message: "ApplicationContext cannot be resolved to a type MainApp.java /HelloSpring/src/com/tutorialspoint line 8 Java Problem"). I configured the build path similar to how all these articles say so:

Eclipse Build Path Not Available

Attach the Source in Eclipse of a Jar

How to use referenced classed in libraries in Eclipse

The attached picture shows my simple file structure with the "Referenced Libraries" expanded to show the JAR file that should resolve the "ApplicationContext" Class.

Screenshot of Eclipse with error message and file structure expanded

I feel like I am missing a simple fix than an experienced Java/Eclipse programmer would see readily. Thanks for any help/suggestions/articles/recommendations you can give!

Tutorial Reference

Spring.io

1 Answers1

0

Let Spring Boot and one of its supported build tools (Maven or Gradle) setup the project for you. That is faster and simpler.
Your project has probably issues with the classpath, which Spring Boot would handle for you.

In my German blog I have this step by step guide to do so:
https://agile-coding.blogspot.com/2020/09/microservices-mit-spring-boot-erstellen.html

Elmar Brauch
  • 1,286
  • 6
  • 20
  • Thank you Elmar Brauch. I read your website tutorial in English using Google Translate: [link](https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=https%3A%2F%2Fagile-coding.blogspot.com%2F2020%2F09%2Fmicroservices-mit-spring-boot-erstellen.html). Great tutorial! Using Spring Boot does seem to work much better! I will do that for now. Thank you! I found this StackOverflow article about my problem: [link](https://stackoverflow.com/questions/15794821/eclipse-error-cannot-be-resolved-to-a-type). I tried their suggestions, but couldn't fix my error. If I figure it out I will post. – Lorenzo_Presto Oct 13 '20 at 15:10