运行JNLP文件时,某些库不起作用

编程入门 行业动态 更新时间:2024-10-24 18:20:23
本文介绍了运行JNLP文件时,某些库不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我从Netbeans运行它时,所有东西都可以在我的Java EE项目中运行,但是当我将其部署到Glassfish服务器并运行下载的JNLP文件时,一些添加的库不起作用。

任何想法?

解决方案

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

< resources> < j2se version =1.6 +/> < jar href =serdarsProject.jarmain =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/> < /资源>

由于Java EE中包含mail.jar和activation.jar,因此您不需要这些当在NetBeans中运行Java EE项目时。

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

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.

Any ideas?

解决方案

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>

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.

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文件时,某些库不起作用

本文发布于:2023-11-23 01:17:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619591.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   文件   JNLP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!