问题
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