下载后无法启动 Java JNLP 应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21203226/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 07:17:29  来源:igfitidea点击:

Unable to launch Java JNLP application after downloading

javajarjava-web-startjnlp

提问by user3116040

I would like to include my java application which I save it as jar file inside web browser. I've tried the Java Web Start tutorial and create the Java JNLP application. I also follow tutorials based on here: http://transvar.org/6112/WebStartAppInstruction.pdf

我想包含我的 java 应用程序,我将它保存为 web 浏览器中的 jar 文件。我已经尝试了 Java Web Start 教程并创建了 Java JNLP 应用程序。我也遵循基于这里的教程:http: //transvar.org/6112/WebStartAppInstruction.pdf

I've tried all the steps but after I download the Launch.jnlp and try to launch it error such "Unable to Launch the application" pop up. I clicked the Details button to check where did I done wrong.

我已经尝试了所有步骤,但是在我下载 Launch.jnlp 并尝试启动它之后,会弹出“无法启动应用程序”这样的错误消息。我点击了详细信息按钮来检查我做错了什么。

Here's the error (Exception tab):

这是错误(异常选项卡):

com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/C:/Users/nurulazila/Documents/NetBeansProjects/fyp_steganalysis/dist/$$codebase/launch.jnlp
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.javaws.Launcher.updateFinalLaunchDesc(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
java.io.FileNotFoundException: C:\Users\nurulazila\Documents\NetBeansProjects\fyp_steganalysis\dist$$codebase\launch.jnlp (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.javaws.Launcher.updateFinalLaunchDesc(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
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="$$codebase" href="launch.jnlp" spec="1.0+">
    <information>
        <title>fyp_steganalysis</title>
        <vendor>nurulazila</vendor>
        <homepage href="www.google.com"/>
        <description>fyp_steganalysis</description>
        <description kind="short">fyp_steganalysis</description>
    </information>
    <update check="always"/>
    <resources>
        <j2se version="1.7+"/>
        <jar href="fyp_steganalysis.jar" main="true"/>
    </resources>
    <application-desc main-class="steganalysisUI">
    </application-desc>
</jnlp>
0(Unknown Source) at com.sun.javaws.Main.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
0(Unknown Source) at com.sun.javaws.Main.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Wrapped Exception Tab:

包装异常选项卡:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>Test page for launching the application via JNLP</title>
    </head>
    <body>
        <h3>Test page for launching the application via JNLP</h3>
        <script src="http://java.com/js/deployJava.js"></script>
        <script>
            deployJava.createWebStartLaunchButton("launch.jnlp")
        </script>
        <!-- Or use the following link element to launch with the application -->
        <!--
        <a href="launch.jnlp">Launch the application</a>
        -->
    </body>
</html>

My code (Launch.jnlp):

我的代码(Launch.jnlp):

<jnlp codebase="http://webpages.uncc.edu/~acenglis" href="launch.jnlp"/>

Launch.HTML:

启动.HTML:

##代码##

I'm really new to Java JNLP. Hoping to get some help here.

我对 Java JNLP 真的很陌生。希望能在这里得到一些帮助。

回答by Keerthivasan

As per linked document, You need to edit it to locate the codebase of your application.i.e

根据链接的文档,您需要编辑它以找到您的应用程序的代码库。ie

##代码##

I don't see that you have followed the tutorial completely (especially editing your jnlp file)

我没有看到您完全按照教程进行操作(尤其是编辑您的 jnlp 文件)