I'm trying to send Mail using SMTP on NetBeans when I get the error message:
run: Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource at SendMail.createMessage(SendMail.java:45) at SendMail.main(SendMail.java:59) Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 2 more C:\Users\Admin\AppData\Local\NetBeans\Cache\12.0\executor-snippets\run.xml:111: The following error occurred while executing this line: C:\Users\Admin\AppData\Local\NetBeans\Cache\12.0\executor-snippets\run.xml:68: Java returned: 1 BUILD FAILED (total time: 0 seconds)
How do I need to fix it?
(I use Apache NetBeans IDE 12.0; Java: 15; Java HotSpot(TM) 64-Bit Server VM 15+36-156)