Monday, January 26, 2009

Testing the JNLP File

In my last blog I attempted to reverse engineer the notepad example and ended up with the following text:

<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for ActiveMath -->

<jnlp spec="1.0+"
<title>Active Math Java Test</title>
<vendor>Softway Interactive Education</vendor>
<description>Active Math Java Test</description>
<homepage href=""/>
<description kind="short">ClickMeApp uses 1 custom class plus 1
standard one</description>
<jar href="ActiveMathJA002.jar"/>
<j2se version="1.6+"
<application-desc main-class="AMJFormA002"/>

which I saved as AMJ002.jnlp.

Before testing this home made code I cut and pasted the whole notepad example, saved it as notepad.jnlp in my web folder, and downnloaded the notepad.jar file into the same folder. I then copied the following from the tutorial:

If you click this link to the Notepad.jnlp file, you open and run the Notepad application from the sun server.

and pasted it into my web page. It obviously worked because it points to the original jnlp file on the original server. I then modified the pasted link as follows.

If you click this link, you open and run the Notepad application from my server.

To my amazement, the link worked, and Notepad opened, when I clicked on the link. (NB mine is a private server and it may not be turned on if and when YOU click on the link).

Then came the real test. Posting a link to my cobbled together file to run my app. Everything seemed to be fine until the moment when the app should have opened, and I got an error message saying: Unable to launch the application Active Math Java Test published by Softway Interactive Education from the server

Disappointing ...

No comments: