Applet blocked by java security settings in java 7
Asked Answered
L

3

8

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.

Lefebvre answered 22/1, 2015 at 5:22 Comment(3)
@saurabh64 - the question you're linking to is about running local applets - not likely related.Antetype
ok ill remove the commentDanidania
I have seen this, It has suggested me to deploy the applet from local server instead of local file system. Btw, thanks :)Lefebvre
T
2

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

Transnational answered 22/1, 2015 at 11:46 Comment(2)
Strange, that should not happen. It is the link of the "Deploying an Applet". However, I am posting the direct link here - docs.oracle.com/javase/tutorial/deployment/applet/… . Hope it will help you.Transnational
Thanks :) I have gone through this link at the very first, but missed some points. Now, using JNLP and with the sample, I have successfully deployed an applet.Lefebvre
A
1

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).
Antetype answered 22/1, 2015 at 5:58 Comment(5)
Thanks for your reply. But I need to work on Java 7 and I think java version is not an issue, not sure though. Applet will be loaded from end users' system. I can't ask user to set their security level. Java 8 does not have that medium option, which may create problem in future.Lefebvre
Did the about:plugins page reveal what it thinks is out of date? Mine tells me I am behind by a few patches and includes a link to update it.Antetype
Are you able to test this on a VM or other box that does have Java 8 installed to see if that addresses the problem? I understand you want Java 7, but now I'm curious if any of my suggestions are useful...Antetype
Java 8 blocks the application mentioning untrusted application. That's weirdLefebvre
"But I need to work on Java 7 and I think java version is not an issue" The error message you quoted suggests otherwise!Emlynne
H
1

From Java 7 Update 10 on all Java releases have an expiration date. Whenever a critical patch update (CPU) is released, the older versions expire.

There were 3 CPUs released for Java 7 since 7u60. You should update to 7u75 or 7u76.

Harney answered 22/1, 2015 at 22:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.