SecurityException on my java applet

冷暖自知 提交于 2019-12-12 03:09:21

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/9324647/securityexception-on-my-java-applet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!