I'm trying to create a simple HelloWorld application with Spring DI. I created a Java project and imported some tutorial classes, one of which is simple this:
package helloworld;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader;
import java.io.FileInputStream;
import java.util.Properties;
public class HelloWorldSpring {
public static void main(String[] args) throws Exception {
// get the bean factory
BeanFactory factory = getBeanFactory();
However I'm getting the following error: The import org.springframework cannot be resolved
.
I'm using Eclipse Spring Tool Suite 3.7.2, and I thought that by using this Eclipse version when I clicked "Fix project setup", it would add these dependencies for me. What am I doing wrong here? Do I need to add these dependencies manually even in STS? If yes, what's the correct way to do it?