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



我想包含我的java应用程序,我将其保存为web浏览器中的jar文件。我已经尝试了JavaWebStart教程,并创建了JavaJNLP应用程序。我还遵循基于以下内容的教程:http://transvar.org/6112/WebStartAppInstruction.pdf

我已经尝试了所有的步骤,但在我下载Launch.jnlp并尝试启动它之后,会弹出"Unable to Launch the application"这样的错误。我单击"详细信息"按钮查看我做错了什么。

以下是错误(异常选项卡):

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$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

包装异常选项卡:

java.io.FileNotFoundException: C:UsersnurulazilaDocumentsNetBeansProjectsfyp_steganalysisdist$$codebaselaunch.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$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

我的代码(Launch.jnlp):

<?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>

Launch.HTML:

<!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>

我真的是Java JNLP的新手。希望在这里得到一些帮助。

根据链接的文档,您需要对其进行编辑以定位应用程序的代码库。即

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

我看你没有完全遵循教程(尤其是编辑你的jnlp文件)

最新更新