Reputation: 7
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
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.
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$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Wrapped Exception Tab:
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)
My code (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>
I'm really new to Java JNLP. Hoping to get some help here.
Upvotes: 0
Views: 35810
Reputation: 12880
As per linked document, You need to edit it to locate the codebase of your application.i.e
<jnlp codebase="http://webpages.uncc.edu/~acenglis" href="launch.jnlp"/>
I don't see that you have followed the tutorial completely (especially editing your jnlp file)
Upvotes: 1