运行 JNLP 文件时某些库不起作用 [英] Some libraries don't work when running JNLP file

查看:50
本文介绍了运行 JNLP 文件时某些库不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从 Netbeans 运行 Java EE 项目时,它在我的 Java EE 项目中一切正常,但是当我将它部署到 Glassfish 服务器并运行下载的 JNLP 文件时,一些添加的库不起作用.

Everything works in my Java EE project when I'm running it from Netbeans, but when I deploy it in Glassfish server and run downloaded JNLP file, some added libraries don't work.

有什么想法吗?

推荐答案

您的程序需要的任何不属于标准 Java SE 发行版的库都必须在 JNLP 文件中引用.您的 JNLP 文件的一部分可能是:

Any library that your program needs that is not part of the standard Java SE distribution must be referenced in the JNLP file. Part of your JNLP file might be:

<resources>
   <j2se version="1.6+"/>
   <jar href="serdarsProject.jar" main="true"/>
   <jar href="lib/activation.jar"/>
   <jar href="lib/mail.jar"/>
   <jar href="lib/jcommon-1.0.16.jar"/>
   <jar href="lib/log4j-1.2.jar"/>
</resources>

因为 mail.jar 和 activation.jar 包含在 Java EE 中,所以在 netbeans 中运行 Java EE 项目时,您的库中不需要这些.

Since mail.jar and activation.jar are included with Java EE, you would not need these in your library when running a Java EE project in netbeans.

在您的首选项中打开 Java 控制台.在 Windows 中,您可以通过控制面板执行此操作 - 该选项位于 Java 控制面板中.当程序中的某些功能无法工作时,您可能会在输出窗口中看到特定的错误消息.这可能会帮助您确定需要包含哪些 jar 库.

Turn on the Java Console in your preferences. In Windows, you can do this through the Control Panel - the option is found in the Java Control Panel. When some function in your program fails to work, you will probably see a specific error message in the output window. This might help you determine which jar libraries you need to include.

这篇关于运行 JNLP 文件时某些库不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆