title: Creating a Java Applet exception: missing <jnlp> field
body: <p>I'm kinda at my wit's end trying to get my Java game to work in a browser. I've successfully managed to get it to run as a Java Web Start application but converting it to an in-browser-window applet is driving me crazy.</p>
  
  <p>MYAPPLET.jnlp:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jnlp href="MYAPPLET.jar" codebase="http://www.myDomain.com/directoryContainingJar/"&gt;
      &lt;information&gt;
          &lt;title&gt;Name&lt;/title&gt;
          &lt;vendor&gt;----&lt;/vendor&gt;
          &lt;offline-allowed /&gt;
      &lt;/information&gt;
      &lt;resources&gt;
          &lt;j2se version="1.4+"
               href="http://java.sun.com/products/autodl/j2se" /&gt;
          &lt;jar href="MYAPPLET.jar" main="true" /&gt;
      &lt;/resources&gt;
      &lt;applet-desc 
          name="Name"
          main-class="main.MainClass"
          width="700"
          height="600"&gt;
      &lt;/applet-desc&gt;
  &lt;/jnlp&gt;
  </code></pre>
  
  <p>In my html file:</p>
  
  <pre><code>&lt;applet width="700" height="600" code="main.MainClass"&gt;
       &lt;param name="jnlp_href" value="MYAPPLET.jnlp"&gt;
  &lt;/applet&gt;
  </code></pre>
  
  <p>I get this error when loading the page:</p>
  
  <pre><code>ExitException[ 3]MissingFieldException[ The following required field is missing from the launch file: &lt;jnlp&gt;]
      at sun.plugin2.applet.JNLP2Manager.redirectLaunchDesc(Unknown Source)
      at sun.plugin2.applet.JNLP2Manager.initialize(Unknown Source)
      at sun.plugin2.main.client.PluginMain.initManager(Unknown Source)
      at sun.plugin2.main.client.PluginMain.access$300(Unknown Source)
      at sun.plugin2.main.client.PluginMain$2.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Error while initializing manager: ExitException[ 3]MissingFieldException[ The following required field is missing from the launch file: &lt;jnlp&gt;], bail out
  </code></pre>
  
  <p>I have changed the main class so that it <code>extends JApplet</code> instead of <code>JFrame</code> but apart from that I don't know what to do.</p>
  
  <p>And yes, I have read <a href="http://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html" rel="nofollow">http://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html</a> and Google'd the error.</p>