简体   繁体   English

JavaMail库上的限制错误

[英]Restriction error on JavaMail library

When trying to use the Session class from the javamail library I get an error: 当尝试使用javamail库中的Session类时,出现错误:

Description Resource Path Location Type Access restriction: The type Session is not accessible due to restriction on required library C:\\Program Files\\Java\\jre7\\lib\\ext\\mail.jar Mailer.java /MailerApp/src line 21 Java Problem

Don't I have the library in the right place? 我没有在正确的地方图书馆吗? I have the folder in the jdf1.7.0_01/jre/lib/ext directory. 我在jdf1.7.0_01/jre/lib/ext目录中有该文件夹。

您无需将库放在jre/lib/ext ,只需以常规方式将其添加到应用程序的类路径中(您无需说出所使用的IDE或构建系统,因此我无济于事“通常的方式”将是)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM