3

By following this example, I got the following inline message in Eclipse Java Oxygen.

"The import javax.activation cannot be resolved"

Documentation for JavaMail says this object is in JAF or moved into jakarta.activation but I don't understand how to fix that, or if the example is too deprecated, or my environment needs to be fixed, or all the previous...

Somebody has a functional example?

user207421
  • 305,947
  • 44
  • 307
  • 483
Brethlosze
  • 1,533
  • 1
  • 22
  • 41
  • 2
    Do you have required jar in your classpath? – SMA Apr 07 '19 at 05:51
  • I included the `javax.mail.jar` and the only error highlighted are the `import javax.activation` lines. – Brethlosze Apr 07 '19 at 05:55
  • 2
    Are you using JDK 9 or newer? JAF was removed from JDK 9, just add it separately from [Maven](https://search.maven.org/artifact/com.sun.activation/javax.activation/1.2.0/jar). – Bill Shannon Apr 07 '19 at 06:29
  • JavaMail doesn't have anything to do with `javax.activation`. If you're using that you need the appropriate JAR file, and it doesn't come from JavaMail. Unclear what you're asking. – user207421 Apr 07 '19 at 10:23
  • @BillShannon Thanks. I added the `javax.activation` JAR and that solved the problem. – Brethlosze Apr 07 '19 at 16:12

0 Answers0