我的应用程序是在Oracle JDK 8上开发的,UI是用javafx写的.UI与javaws一起运行,但是openWebstart无法启动相同的UI,并出现错误"Application Error:Not a launchable JNLP file". 下面是日志(log)片段:

[ITW-CORE][2023-10-25 16:00:51.610 IST][INFO ][net.sourceforge.jnlp.Parser] good - your JRE - 1.8.0_372 - match requested JRE - 1.8+
[ITW-CORE][2023-10-25 16:00:51.630 IST][ERROR][net.sourceforge.jnlp.AbstractLaunchHandler]
netx: Application Error: Not a launchable JNLP file.
net.sourceforge.jnlp.LaunchException: Fatal: Application Error: Not a launchable JNLP file. File must be a JNLP application, applet, or installer type.
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:670)
[ITW-CORE][2023-10-25 16:00:51.631 IST][ERROR][net.sourceforge.jnlp.Launcher]
Launch exception
net.sourceforge.jnlp.LaunchException: Fatal: Application Error: Not a launchable JNLP file. File must be a JNLP application, applet, or installer type.
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:670)
[ITW-CORE][2023-10-25 16:00:59.350 IST][INFO ][net.sourceforge.jnlp.util.logging.OutputController] Increase polling interval for shutdown phase
[ITW-CORE][2023-10-25 16:00:59.357 IST][INFO ][net.adoptopenjdk.icedteaweb.resources.cache.CacheImpl] No other instances of javaws are running

从他们的官方网站下载了OWS.使其成为打开jnlp文件的默认应用程序.在OWS设置中的JVM管理器中添加了Java 1.8

Jnlp文件:

<?xml version="1.0" encoding="ISO-8859-1"?>
<jnlp spec="1.0+" codebase="http://172.17.147.60:18080/pwui" href="pwui.jnlp">
   <information>
      <title>Management Client</title>
      <icon kind="shortcut" href="image.jpg"/> 
      <shortcut online="true">
         <desktop/>
      </shortcut>
   </information>
   <resources>
      <j2se version="1.8+" java-vm-args="-XX:MaxPermSize=256m" />
      <jar href="Client.jar" main="true" />
      <jar href="Common.jar" main="false" />
      <jar href="EJBClient.jar" main="false" />
      <jar href="jnlp.jar" main="false" />
      <jar href="jbossall-client.jar" main="false" />
      <jar href="FXExperienceControls.jar" main="false" />
      <jar href="commons-codec-1.7.jar" main="false" />
      <jar href="commons-io.jar" main="false" />
      <jar href="itextpdf-5.4.1.jar" main="false" />
   </resources>
   <security><all-permissions/></security>
   <jfx:javafx-desc  main-class="com.client.fx.login.LoginScreen" />
   <update check="always" policy="always" />
</jnlp>

推荐答案

据我所知,在OpenWebStart的幕后使用的IcedTea-Web不支持jfx:javafx-desc.

相反,您需要有一个application-desc来定义主类.

另请参阅OpenWebStart常见问题条目:https://openwebstart.com/docs/FAQ.html#_how_to_run_openjfx_based_javafx_applications_with_openwebstar

Java相关问答推荐

如何从片段请求数据到活动?在主要活动中单击按钮请求数据?

使用Apache Poi MQLSlideShow,在XSLFTable表中,我们可以在文本段落后面的每个单元格中包含圆角矩形吗?

Java中不同包中的类之间的配置共享

在Java中将Charsequence数组更改为String数组或List String<>

Springdoc Whitelabel Error Page with Spring V3

Jooq外键关系

Java inline Double条件和值解装箱崩溃

如何获得执行人?

名称冲突具有相同的擦除

Java编译器抛出可能未正确初始化的错误?

我正在try 跟踪数组中最大的两个数字

如何解释Java中for-each循环中对Iterable的强制转换方法引用?

虚拟线程应该很快消亡吗?

如何使用Criteria Builder处理一对多关系中的空值?

除0错误/抱歉我的句子是PT

IntelliJ IDEA中的JavaFX应用程序无法在资源中找到CSS文件

为什么JavaFX MediaPlayer音频播放在Windows和Mac上运行良好,但在Linux(POPOS/Ubuntu)上却有问题?

如何在Java中的重写方法参数中强制(Enum)接口实现?

为什么没有加载java.se模块?

转换为JSON字符串时,日期按天递减-Java