javax.activation.datasource找不到的类文件

发布于 2025-01-26 17:50:16 字数 543 浏览 2 评论 0原文

没有汇编错误,但是当我尝试使用maven构建它时,它会引发以下错误,并使

我使用Java 11 Open JDK

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project notification-functionapp: Compilation failure
[ERROR] MailSender.java:[112,37] cannot access javax.activation.DataSource
[ERROR] class file for javax.activation.DataSource not found

在112 Mailsender.java of Mailsender.java上失败了此下面的代码行

  final Multipart multipart = new MimeMultipart("alternative");

There is no compilation error, but the moment I try to build it using maven it throws the following error and fails the build

I'm using Java 11 Open JDK

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project notification-functionapp: Compilation failure
[ERROR] MailSender.java:[112,37] cannot access javax.activation.DataSource
[ERROR] class file for javax.activation.DataSource not found

At 112 line of MailSender.java this following line of code is there

  final Multipart multipart = new MimeMultipart("alternative");

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鸩远一方 2025-02-02 17:50:16

javax.activation似乎在Java 11 Open JDK中固有地存在,因此,如果您遇到此错误,请在您的pom.xml或build.gradle.gradle

maven <

<dependency>
    <groupId>com.sun.activation</groupId>
    <artifactId>javax.activation</artifactId>
    <version>1.2.0</version>
</dependency>

strong gradle

compile 'com.sun.activation:javax.activation:1.2.0'

javax.activation seems to be not present inherently in Java 11 Open JDK, so if you encounter this error please add the following dependency in you pom.xml or build.gradle

Maven

<dependency>
    <groupId>com.sun.activation</groupId>
    <artifactId>javax.activation</artifactId>
    <version>1.2.0</version>
</dependency>

Gradle

compile 'com.sun.activation:javax.activation:1.2.0'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文