Java Web Start Offline mode not possible with JRE 8u171

爱⌒轻易说出口 提交于 2021-02-07 17:54:11

问题


Does anyone still uses Java Web Start? Well I certanly have to.

I have an application that needs to run in online and offline mode. Online for getting updates, but the actual use case is offline.

Up to jre8u161 that worked fine. But with the current Updates 171 and 172 the application won't start in offline mode.

If I force it to offline mode with the Java Cache Viewer I get the exception:

com.sun.deploy.net.FailedDownloadException: Ressource kann nicht heruntergeladen werden. System ist offline. (Resource can not be downloaded. System is offline.)
    at com.sun.deploy.cache.ResourceProviderImpl.checkUpdateAvailable(Unknown Source)
    at com.sun.deploy.cache.ResourceProviderImpl.isUpdateAvailable(Unknown Source)
    at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
    at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
    at com.sun.deploy.model.ResourceProvider.getResource(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.launch(Unknown Source)
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

If I start it with javaws -offline <jnlp-file> I get the message "Anwedung im Offlinebetrieb nicht verfügbar" (Application in offline mode not available).

I created a minimal application with this jnlp-file:

<jnlp spec="7.0" codebase="<URL>" href="<jnlp-file>"
  <information>
    <title>Base Test</title>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <jar href="<jar-file>"/>
  </resources>
  <application-desc main-class="test.BaseTest"/>
</jnlp>

But this also won't start in offline mode.

What else can I do?


回答1:


This is a know bug of JDK 8 171 https://bugs.openjdk.java.net/browse/JDK-8203272

This is fixed in later version of JAVA (able to launch jnlp in offline mode with java 10 )

There is no way to launch JNLP in off line mode with 8-171 java update.

FOR DESKTOP SHORTCUT LAUNCH One of the work around would be(It is just a hack) 1. create 2 different jnlp one for java 8-171 and another for launch jnlp in offline mode for other java versions.

  1. Create a launcher jnlp app which detect version of java on client local and launch respective jnlp.

(I am current working on it will update code when done)

USE this config in JNLP

JAVA 8 171

          <offline-allowed/>
           <shortcut>
            <desktop/>
           </shortcut>

JAVA OTHER version

          `<offline-allowed/>
           <shortcut online="false">
             <desktop/>
           </shortcut>`


来源:https://stackoverflow.com/questions/50058869/java-web-start-offline-mode-not-possible-with-jre-8u171

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!