本地Applet安全例外 [英] Local Applet Security Exception
问题描述
我想在我的浏览器中运行一个基本的Hello World Java小程序,但我不断收到以下消息的安全设置阻止应用程序:
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异常:您的安全设置都从运行阻止本地应用程序
SecurityException: Your security settings have blocked a local application from running
我试图通过 Java控制面板更改安全设置,但没有滑块,只是证书。
I tried changing the security settings through the Java Control Panel, but there is no slider, just certificates.
尝试在其他浏览器中打开.html文件时,我得到了同样的错误。
I get the same error when trying to open the .html file in other browsers.
小程序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?
推荐答案
好吧,删除的Java 6和7,然后重新安装7并重新启动计算机后,它现在的作品。不知道我不得不删除旧版本我更新到7,因为我以为这是在更新自动完成后还是一样。
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.
<一个href=\"http://answers.ea.com/t5/Pogo/Solution-WINDOWS-Java-issues-step-by-step/m-p/393326/highlight/true#M14757\"相对=nofollow>这个网站提供了指导。我的坏这么简单的问题。
This site provided guidance. My bad for such a simple question.
这篇关于本地Applet安全例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!