Skip to content
Advertisement

Eclipse: java.lang.NoClassDefFoundError: javax/activation/DataHandler

I’m trying to send an email in java. Here’s the code:

JavaScript

When I compile the project, on line:

JavaScript

…the following error comes out:

JavaScript

Note: I’m using java -version: 9.0.4

Advertisement

Answer

JDK 9 disables access to many of the javax.* APIs by default, javax activation is now deprecated.

However you can resolve it with adding the module at run time

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement