title: How to load a Java applet class from a subfolder with the embed tag?
body: <p>I have a Java Applet as a single class file (No JAR file) in some sub directory and I want to embed it on a HTML page which is in a different directory. And I want to use the <code>embed</code> tag for it. But I can't get it working. This is my code so far:</p>
  
  <pre><code>&lt;embed type="application/x-java-applet;version=1.6"
         width="512" height="512"
         code="subfolder/MyApplet.class" /&gt;
  </code></pre>
  
  <p>According to the Apache log file the Class file is loaded but it can't be started. Java says there is no class with name <code>subfolder.MyApplet</code>. So it treats the sub directory as a package name. A <code>codebase</code> parameter (No idea if this is valid for <code>embed</code>) doesn't make a difference. Maybe there is some other badly documented parameter to specifiy a code base directory from which to load the classes? </p>
  
  <p>Please note that my question is not about how to embed a Java applet in general. I know how to get it running with the deprecated <code>applet</code> tag or the <code>object</code> tag and by packaging the class into a JAR file. My question is how to get it working in exactly this specific situation:</p>
  
  <ul>
  <li>No JAR file, only single class file.</li>
  <li>Class file is not in the same directory as the HTML page.</li>
  <li>Using <code>embed</code> tag.</li>
  </ul>