2014-01-18 54 views
0

我想包括我的Java应用程序,我将它作为jar文件保存在Web浏览器中。我已经尝试了Java Web Start教程并创建了Java JNLP应用程序。我也遵循基于这里的教程:http://transvar.org/6112/WebStartAppInstruction.pdf下载后无法启动Java JNLP应用程序

我已经尝试了所有的步骤,但在我下载Launch.jnlp并尝试启动它的错误,如“无法启动应用程序”弹出。我点击了Details按钮来检查我做错了什么。

这里的错误(例外标签):

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:\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$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。希望能在这里得到一些帮助。

+0

问题是你的代码库。请注意,最近的jnlp规范版本不需要指定它。因此,删除jnlp中的codebase属性并将规范更改为7.0+可能会解决您的问题。 – assylias

+0

@assylias我试过你的方法。当我点击Launch.jnlp本身时,应用程序弹出错误“应用程序被阻止......”。我想它必须与Java设置有关。但是,当我从浏览器下载“无法启动应用程序”再次弹出。我不知道现在该做什么。 – user3116040

+0

您是否正在启动Java 7 JRE?当您遇到诸如“无法启动应用程序”等错误时,您应该有一个链接,如“更多信息”,其中包含有用的疑难解答信息。 – assylias

回答

1

按照链接的文档,你需要编辑它来找到您的application.ie

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

的代码库,我不知道你已经完全跟着教程(尤其是编辑JNLP文件)

+0

这样的教程在哪里? –

+0

我说过问题中的链接 – Keerthivasan

相关问题