Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applet blocked by java security settings in java 7

Tags:

java

applet

I am trying to deploy a test demo applet. The code of applet is presented in following


import java.applet.Applet;
import java.awt.Graphics;

public class TestApplet extends Applet{

    public void paint(Graphics gh){
        gh.drawString("hello world", 300, 200);
    }
}

I have also used a manifest file which is included in jar containing the following lines

Permissions: sandbox

Application-Name: Applet Demo

Then I have signed the jar using jarsigner with a keystore containing trusted certificate from thawte. Jarsigner can also verify the signed jar with appropriate certificate chain. I have also installed that .p12(keystore) file in the system

After that I tried to load the applet from local server through Chrome browser. Following is my html code

<html>
<Title>Applet Testing</Title>
<hr>
<applet code="TestApplet.class"
    archive="SignedTestApplet.jar"
    width="480" height="320">
<param name="Permissions" value="sandbox"/>
<param name="Application-Name" value="Applet Demo"/>
</applet>
<hr>
<html>

After following all the procedures described above, I get the following pop-up response


Your security settings have blocked an application from running with an out-of-date or expired version of java


I am using java 7 update 60 and it works if I set the security level as medium from Java Control Panel, but I have to keep the level as high.

Is there any flaw in my procedures or what should be done??

Please suggest me.

like image 525
Maruful Haque Avatar asked Jan 22 '15 05:01

Maruful Haque


2 Answers

You are trying to load the java applet by an old method which has been changed. A new method has been introduced which uses JNLP (Java Network Launch Protocol). Please try to deploy your applet following the instructions described in this LINK

like image 179
Saqib Rezwan Avatar answered Nov 08 '22 01:11

Saqib Rezwan


You have a few options:

  1. Install a newer version of Java (Java 8 is now available). If you go to about:plugins in Chrome, you can find Java here and which version your browser is using (there is an 'Always Allowed' checkbox here too, but it seemingly has no effect for me).
  2. Start Chrome with the flag --allow-outdated-plugins - See the related Chrome help page for info on this.
  3. Set security level as medium from Java Control Panel (as you describe in your question).
like image 27
Krease Avatar answered Nov 08 '22 01:11

Krease