JNLP 中的 Javax.mail

发布于 2024-08-12 12:58:50 字数 224 浏览 2 评论 0原文

我的程序有问题。我在 Netbeans 中开发,当我运行该程序时,它运行良好。我构建了它,创建了一个 *.jar 文件,并将其更新到我的 JNLP 文件中。

麻烦来了。因为我在程序中使用 javax.mail.* ,所以 jnlp 包只是忽略它的所有部分。

需要明确的是,我正在开发邮件客户端。现在我可以检查收件箱中的邮件数量。这就是程序在 JNLP 中忽略的内容。

感谢您的任何帮助。

I have a problem with my program. I develop in Netbeans, and when i run the program it is working fine. i built it, created a *.jar file, and updatet it in my JNLP file.

here comes the trouble. as i'm using javax.mail.* in my program, the jnlp package just ignores all parts of it.

Just to be clear, i'm working on a mail client. now i can check the numbers of the mails in the inbox. that is what the program ignores in JNLP.

Thanks for any help.

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

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

发布评论

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

评论(3

尹雨沫 2024-08-19 12:58:50

合并 javamail 实现。从许可的角度来看,Apache Geronimo 实现很方便。也就是说,获取一个包含 javax.mail 实现(除了 j2ee 中内置的实现)的 JAR 文件,并将其打包到 JNLP 包中。

Incorporate a javamail implementation. The Apache Geronimo implementation is convenient from an licensing standpoint. That is, get a JAR file containing an implementation of javax.mail (other than the one built into j2ee) and package that into your JNLP package.

情绪操控生活 2024-08-19 12:58:50

我认为您需要做的就是签署 java 邮件实现(本机或某些第三方)JAR,将它们添加到您的 JNLP 文件中:

<resources>
   <jar href="mail-jar1"/>
   <jar href="mail-jar2"/>
   <!-- more -->
</resources>

...并且然后将它们与您的主 JAR 一起放到您选择的 Web 服务器上。

I think all you need to do is to sign java mail implementation (either native or some 3rd party) JAR's, add them to your JNLP file:

<resources>
   <jar href="mail-jar1"/>
   <jar href="mail-jar2"/>
   <!-- more -->
</resources>

...and then drop them along with your main JAR to your web server of choice.

倾城花音 2024-08-19 12:58:50

为了让您的程序能够访问网络并与邮件服务器通信,您需要对所有 jar 进行签名并在 jnlp 文件中包含以下代码:

<security>
    <all-permissions/>
</security>

如果您使用 Java EE 邮件实现,则需要包含两个库中的 jar 文件:

<resources>
    <jar href="lib/activation.jar"/>
    <jar href="lib/mail.jar"/>
</resources>

我喜欢将所有库 jar 文件放在一个单独的文件夹中,这就是 netbeans 在构建应用程序时通常为您所做的事情(查看 dist 文件夹)。

您还问“您能否提供一种在我的计算机上运行该程序而无需 netbeans 和命令提示符的方法?”

这几乎就是 jnlp 的全部要点。您可以从网络浏览器启动该程序。 java 教程包含许多这样的示例:
例如: JButton 示例

如果这是您希望的方式部署您的应用程序,您可以阅读 Web Start 开发人员指南

In order for your program to have access to the network and communicate with a mail server, you need to sign all of the jars and include in the jnlp file this code:

<security>
    <all-permissions/>
</security>

If you use the Java EE mail implementation, then you need to include two jar files in your library:

<resources>
    <jar href="lib/activation.jar"/>
    <jar href="lib/mail.jar"/>
</resources>

I like to place all of the library jar files in a separate folder, which is what netbeans normally does for you when it builds you app (look in the dist folder).

You also asked "can u offer me a way to run this program on my computer without netbeans and command prompt?"

That is pretty much the whole point of jnlp. You can launch the program from a web browser. The java tutorial contains many examples of this:
For example: JButton example

If this is the way you wish to deploy your application, you can read the Web Start developers guide.

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