dzoniBravo dzoniBravo - 1 month ago 4x
Java Question

Can't import org.springframework.context.ApplicationContext?

I just started learning Spring and I have problem importing Classes from Spring, please help! I tried almost everything what I found as a solutions, but it was a failure...


The import org.springframework.context.ApplicationContext cannot be

Here's my code

import org.springframework.context.*; //I can import this
import org.springframework.context.ApplicationContext; //But I can't import this


import org.springframework.stereotype.*; //I can import this
import org.springframework.stereotype.Controller; //But I can't import this

this is my pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi=""





ApplicationContext resides in that package.

In your IDE if you control click on the import statement it should show you which jar it is resolving to. If it isnt run mvn clean install which will build and pull dependencies you need

Your project may not be auto importing maven dependencies so it doesn't yet resolve.