在浏览器(chrome/firefox)中运行本地 java 小程序“您的安全设置已阻止本地应用程序运行”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16376087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Run local java applet in browser (chrome/firefox) "Your security settings have blocked a local application from running"
提问by ymerdrengene
I'm trying to run a Java Applet(html file), but the browser keeps saying:
我正在尝试运行Java Applet(html 文件),但浏览器一直说:
"Your security settings have blocked a local application from running"
“您的安全设置已阻止本地应用程序运行”
I have tried using Chrome and Firefox but i get the same error. I have upgraded to the latest version of Java, but Chrome still says in
我曾尝试使用 Chrome 和 Firefox,但出现相同的错误。我已升级到最新版本的 Java,但 Chrome 仍然显示
chrome://plugins/ "Download Critical Security Update"
chrome://plugins/“下载关键安全更新”
even though i can run Java applets (not locally)
即使我可以运行 Java 小程序(不在本地)
Im using Ubuntu 13.04 64 bit
我使用的是Ubuntu 13.04 64 位
采纳答案by Andrew Thompson
After reading Java 7 Update 21 Security Improvements in Detail mention..
阅读Java 7 Update 21 Security Improvements in Detail 后提到..
With the introduced changes it is most likely that no end-user is able to run your application when they are either self-signed or unsigned.
通过引入的更改,很可能没有最终用户能够在自签名或未签名时运行您的应用程序。
..I was wondering how this would go for loose class files - the 'simplest' applets of all.
..我想知道这对于松散的类文件会如何处理——“最简单”的小程序。
Local file system
本地文件系统
Your security settings have blocked a local application from running
您的安全设置已阻止本地应用程序运行
That is the dialog seen for an applet consisting of loose class files being loaded off the local file systemwhen the JRE is set to the default 'High' security setting.
这是当 JRE 设置为默认的“高”安全设置时,由从本地文件系统加载的松散类文件组成的小程序的对话框。
Note that a slight quirk of the JRE only produced that on point 3 of.
请注意,JRE 的一个小怪癖只产生了第 3 点。
- Load the applet page to see a broken applet symbol that leads to an empty console.
Open the Java settings and set the level to Medium.
Close browser & Java settings. - Load the applet page to see the applet.
Open the Java settings and set the level to High.
Close browser & Java settings. - Load the applet page to see a broken applet symbol & the above dialog.
- 加载小程序页面以查看导致空控制台的损坏小程序符号。
打开 Java 设置并将级别设置为Medium。
关闭浏览器和 Java 设置。 - 加载小程序页面以查看小程序。
打开 Java 设置并将级别设置为High。
关闭浏览器和 Java 设置。 - 加载小程序页面以查看损坏的小程序符号和上面的对话框。
Internet
互联网
If you load the simple applet (loose class file) seen at this resizable applet demooff the internet- which boasts an applet
element of:
如果您从Internet 上加载在这个可调整大小的小程序演示中看到的简单小程序(松散的类文件)- 它拥有以下元素:applet
<applet
code="PlafChanger.class"
codebase="."
alt="Pluggable Look'n'Feel Changer appears here if Java is enabled"
width='100%'
height='250'>
<p>Pluggable Look'n'Feel Changer appears here in a Java capable browser.</p>
</applet>
It also seems to load successfully. Implying that:-
它似乎也成功加载。暗示:-
Applets loaded from the local file system are now subject to a stricter security sandbox than those loaded from the internet or a local server.
从本地文件系统加载的小程序现在受到比从 Internet 或本地服务器加载的更严格的安全沙箱的约束。
Security settings descriptions
安全设置说明
As of Java 7 update 51.
从 Java 7 更新 51 开始。
- Very High: Most secure setting - Only Java applications identified by a non-expired certificate from a trusted authority will be allowed to run.
- High (minimum recommended): Java applications identified by a certificate from a trusted authority will be allowed to run.
- Medium- All Java applications will be allowed to run after presenting a security prompt.
- 非常高:最安全的设置 - 仅允许运行由来自受信任机构的未过期证书标识的 Java 应用程序。
- 高(推荐最低值):允许运行由受信任机构颁发的证书标识的 Java 应用程序。
- 中-在出现安全提示后,所有 Java 应用程序都将被允许运行。
回答by Juned Ahsan
I think the upgrade of Java will not help. You need to uninstall the old version and then install the latest java version to help you. Make sure that you restart the computer once you are done with the installation.
我认为升级Java无济于事。您需要卸载旧版本,然后安装最新的java 版本来帮助您。确保在完成安装后重新启动计算机。
Hope it helps!
希望能帮助到你!
回答by Shay
This problem happens when older versions of java still on your system disrupt any new versions installed. To stop this problem you need to first remove all java software using - Control Panel + Remove Programs + then uninstall java. (At this stage, I recommend cleaning out your registry using CCleaner using their Registry option or similar program to ensure a clean sweep then reboot) After rebooting reinstall the most recent version of java and all will be well.
当您的系统上仍然有旧版本的 java 中断安装的任何新版本时,就会发生此问题。要解决此问题,您需要首先使用 - 控制面板 + 删除程序 + 删除所有 java 软件,然后卸载 java。(在此阶段,我建议使用 CCleaner 使用其注册表选项或类似程序清理您的注册表,以确保彻底清除然后重新启动)重新启动后重新安装最新版本的 java,一切都会好起来的。
http://www.filehippo.com/download_ccleaner-LINK TO CCLEANER
http://www.filehippo.com/download_ccleaner-CCLEANER 链接
回答by Somil Jain
just add your .jar file in applet tag as an attribute as shown below:
只需在小程序标记中添加您的 .jar 文件作为属性,如下所示:
<applet
code="file.class"
archive="file.jar"
height=550
width=1100>
</applet>
回答by user2849159
Go to java control tab>java control pannel>click security tab>down the security level to medium. Then applet progrramme after 2to 3 security promt it will run.
转到java控制选项卡>java控制面板>单击安全选项卡>将安全级别降低到中等。然后小程序程序将在 2 到 3 个安全提示后运行。
回答by Doro
For XP: Start > Control Panel > Java > Security > (Set to Medium) http://www.java.com/en/download/help/java_update.xml
对于 XP:开始 > 控制面板 > Java > 安全 >(设置为中) http://www.java.com/en/download/help/java_update.xml
回答by royal charlie
In my case, this has been resolved by going to control panel > java > security > then add url in the exception site list. Then apply. Test again the site and it should now allow you to run the local java.
就我而言,这已通过转到控制面板> java > 安全性> 然后在例外站点列表中添加 url 来解决。然后申请。再次测试站点,它现在应该允许您运行本地 java。
回答by ?MER TA?CI
- Make a jar file from your applet class and META-INF/MANIFEST.MF file.
- Sign your jar file with your certificate.
- Configure your local site permissions as > file:///C:/ or http: //localhost:8080
- Then run your html document on Intenet Exploreron Windows.(Not Google Chrome !)
- 从您的小程序类和 META-INF/MANIFEST.MF 文件制作一个 jar 文件。
- 使用您的证书签署您的 jar 文件。
- 将您的本地站点权限配置为 > file:///C:/ 或 http://localhost:8080
- 然后在 Windows上的Internet Explorer上运行您的 html 文档。(不是 Google Chrome !)