I am getting the below error when running a simple Java project using Spring 5.
Error: Unable to initialize main class org.abhinash.javabrains.AopMain Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
Below is my main class
public class AopMain {
public static void main(String[] args) {
ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
ShapeService shapeService = (ShapeService) ctx.getBean("shapes");
System.out.println(shapeService.getCircle().getName());
}
}
This is a simple Java project with no maven dependencies. I have added all the jars from spring 5 in my Classpath. Below is the screenshot from project explorer
Below is from my classpath
I was only able to find answers related to this topic when the dependencies are added through maven. for example: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext maven
ClassNotFoundException for included dependency
Thanks in Advance!!