JNLP 中的 Javax.mail
我的程序有问题。我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
合并 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.
我认为您需要做的就是签署 java 邮件实现(本机或某些第三方)
JAR
,将它们添加到您的JNLP
文件中:...并且然后将它们与您的主
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 yourJNLP
file:...and then drop them along with your main
JAR
to your web server of choice.为了让您的程序能够访问网络并与邮件服务器通信,您需要对所有 jar 进行签名并在 jnlp 文件中包含以下代码:
如果您使用 Java EE 邮件实现,则需要包含两个库中的 jar 文件:
我喜欢将所有库 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:
If you use the Java EE mail implementation, then you need to include two jar files in your library:
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.