我的 java 小程序上出现 SecurityException
当我尝试使用小程序时,我收到 java.lang.SecurityException: Permission returned: file:////Videos/public/scripts/screenshot.jar
。
这是小程序代码:
<applet code="Screenshot" archive="file:////Videos/public/scripts/screenshot.jar" width="100px" height="100px">
</applet>
我已经使用此 3 步指南签署了小程序,但它似乎对我不起作用,因为我仍然收到错误。 http://www.narendranaidu .com/2007/11/3-easy-steps-to-self-sign-applet-jar.html
I am getting the java.lang.SecurityException: Permission denied: file:////Videos/public/scripts/screenshot.jar
when I try to use an applet.
Here is the applet code:
<applet code="Screenshot" archive="file:////Videos/public/scripts/screenshot.jar" width="100px" height="100px">
</applet>
I've signed the applet using this 3-step guide, but it doesn't seem it worked for me, as I am still getting the error.
http://www.narendranaidu.com/2007/11/3-easy-steps-to-self-sign-applet-jar.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的 jar URL 看起来很奇怪。就我个人而言,我从未见过有人尝试从 HTTP 以外的 URL 下载小程序。实际上,这意味着您的小程序仅适用于进入您的 LAN 的用户,他们可以访问名为“Videos”的共享计算机。你确定这是你想要的吗?
第二件事是:尝试将 JAR URL 复制并粘贴到您的 Web 浏览器中,看看会发生什么。如果您能够直接下载 jar 文件而无需输入密码,那么当 URL 放入 applet 标签中时,这应该可以工作。否则就不会。因此,首先检查您的 URL 并解决其问题。
Your jar URL looks strange. Personally I have never seen that somebody tries to download applet from URL other than HTTP. Actually it means that your applet will work only for users that are into your LAN where they have access to shared computer named "Videos". Are you sure this is what you want?
The second thing is: try to just copy and paste the JAR URL to your web browser and see what will happen. If you are able to download the jar file directly without entering password this should work when URL is placed into the applet tag. Otherwise it will not. So, first check your URL and fix its problem.