Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local Applet Security Exception

I'm trying to run a basic hello world Java applet in my browser, but I keep getting "Application Blocked by Security Settings" with the following message:

SecurityException: Your security settings have blocked a local application from running

I tried changing the security settings through the Java Control Panel, but there is no slider, just certificates.

I get the same error when trying to open the .html file in other browsers.

Applet code:

import javax.swing.*;
import java.awt.*;

public class HelloWorldApp extends JApplet
{
    public void init()
    {
        JLabel label = new JLabel("Hello World");
        add(label);
    }
}

HTML

<!DOCTYPE html>
<html>
<head></head>    
<body>    
   <applet code="HelloWorldApp.class" width="300" height="100"></applet>    
</body>    
</html>

Question: How can I get the applet to work? Or rather, how can I change the security settings to allow the applet to run locally, if that is the issue and not something else?

like image 799
daneshjai Avatar asked Nov 13 '22 07:11

daneshjai


1 Answers

Okay, after deleting Java 6 and 7 and re-installing 7 and restarting the computer, it now works. Did not know I had to delete the older version even after I updated to 7 as I thought that was done automatically on update.

This site provided guidance. My bad for such a simple question.

like image 145
daneshjai Avatar answered Nov 15 '22 11:11

daneshjai