JavaMail with Spring - Missing Imports

java, spring

Solution

You are missing `org.springframework.context.support-3.1.1.RELEASE.jar`

or

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>3.1.1.RELEASE</version>
</dependency>

if you're using Maven.

Problem

I am getting a The import cannot be resolved error for the following imports, ``` import org.springframework.mail.MailSender; import org.springframework.mail.SimpleMailMessage; ``` I have the following libraries in the classpath, but I not sure which jar file has the above-mentioned imports. Does anybody have any idea? ``` org.springframework.aop-3.1.1.RELEASE.jar org.springframework.asm-3.1.1.RELEASE.jar org.springframework.beans-3.1.1.RELEASE.jar org.springframework.context-3.1.1.RELEASE.jar org.springframework.core-3.1.1.RELEASE.jar org.springframework.expression-3.1.1.RELEASE.jar org.springframework.jdbc-3.1.1.RELEASE.jar org.springframework.orm-3.1.1.RELEASE.jar org.springframework.web-3.1.1.RELEASE.jar ```

Original source