javax.activation

What is the replacement for javax.activation package in java 9?

半城伤御伤魂 提交于 2019-12-17 03:08:49
问题 Seems like javax.activation package is deprecated in Java 9. Oracle migration guide proposes to use --add-modules java.activation option during JVM start. However, I would like to avoid this and replace javax.activation package's classes, as it is deprecated and will be removed in future java versions. I suppose, there should be some kind of alternative for javax.activation . If there is any available, what is it? 回答1: JavaBeans Activation Framework (JAF) is possibly the alternative you are

Error in Sending mail by Java

邮差的信 提交于 2019-12-10 19:36:07
问题 My code is : // File Name SendEmail.java import java.util.*; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; public class SendEmail { public static void main(String [] args) { // Recipient's email ID needs to be mentioned. String to = "toEmail@gmail.com"; // Sender's email ID needs to be mentioned String from = "fromEmail@gmail.com"; // Assuming you are sending email from localhost String host = "localhost"; // Get system properties Properties properties = System

Send email with javax.mail using an existing InputStream as attachment content

允我心安 提交于 2019-12-10 13:36:50
问题 Is it possible to send an email using javax.mail and using an “existing” InputStream for the email message attachment content? Currently I am building the email message as follows: final MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); message.setSubject("Subject line"); final Multipart multipartContent = new MimeMultipart(); final MimeBodyPart textPart = new MimeBodyPart();

What is the replacement for javax.activation package in java 9?

橙三吉。 提交于 2019-11-26 16:15:51
Seems like javax.activation package is deprecated in Java 9. Oracle migration guide proposes to use --add-modules java.activation option during JVM start. However, I would like to avoid this and replace javax.activation package's classes, as it is deprecated and will be removed in future java versions. I suppose, there should be some kind of alternative for javax.activation . If there is any available, what is it? Naman JavaBeans Activation Framework (JAF) is possibly the alternative you are looking for to the existing package. This standalone release of JAF uses a Java Platform Module System