title: Java applet permission denied, security exception
body: <p>I started learning Java a few weeks ago and now I am in the process of creating a japplet game.</p>
  
  <p>I am using Mac os x and whenever I try to run the applet in the browser I get the following exception</p>
  
  <pre><code>java.lang.SecurityException: Permission denied:
  </code></pre>
  
  <p>How can I fix this so the JApplet would run? The files are all on local and I'm running the JApplet locally in the browser.</p>
  
  <p>The following the is html code</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Java Game!&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;applet code="/local/path/to/MainApplet.class"
              width=500
              height=500&gt;
      &lt;/applet&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>The following is the full console output:</p>
  
  <pre><code>Java.lang.SecurityException: Permission denied:
   file:/path/to/MainApplet.class
      at sun.plugin2.applet.Applet2ClassLoader$1.run(Applet2ClassLoader.java:209)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:201)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:249)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:179)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:160)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:678)
      at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3045)
      at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1497)
      at java.lang.Thread.run(Thread.java:680)
  Exception: java.lang.SecurityException: Permission denied: file:/path/to/MainApplet.class
  </code></pre>
  
  <p><strong>UPDATE #2</strong></p>
  
  <p>I tried the same code in Windows and there was no problem at all. It's only on Mac that's giving this exception, any ideas?</p>