tom
tom

Reputation: 5514

Import can not resolve error

In my Spring web application i am trying to import below given imports to annotate my class as @Configuration and method as @Bean

import org.springframework.context.annotation.Bean;

import org.springframework.context.annotation.Configuration;

But i am reciving compile time error that the imports does not resolve.

Do i need to add any perticular jar for these imports?

Upvotes: 0

Views: 71

Answers (3)

M Abbas
M Abbas

Reputation: 6479

You need to add spring-context in your classpath.

You can find the library here or here.

Upvotes: 1

Sajan Chandran
Sajan Chandran

Reputation: 11487

Use Jar Finder, search by class name

 org.springframework.context.annotation.Bean
 org.springframework.context.annotation.Configuration

and then add the necessary jars to your build path.

Upvotes: 1

zbess
zbess

Reputation: 852

Make sure the Spring jars are present and that they are included as libraries in your project.

Upvotes: 0

Related Questions