Warning on Permissions attribute when running an applet with JRE 7u45

前端 未结 12 536
太阳男子
太阳男子 2020-12-14 02:04

I\'ve just upgraded JRE to 7u45, and my applet receives a warning message on start-up, saying \" This application will be blocked in a future Java security update because th

12条回答
  •  爱一瞬间的悲伤
    2020-12-14 02:40

    After spending some time breaking my head on editing manifest (see how to config manifest with maven) and all those java configurations, I've found how it works:

    To grant allPermissions with java 1.7+ you need to edit java.policy file.

    Use the policytool to do that. At prompt command line:

    policytool
    

    see Oracle tutorial: http://docs.oracle.com/javase/tutorial/security/tour1/wstep2.html

    Open the right policy file where your browser vm is executing. For me its in:

    C:\Program Files (x86)\Java\jre7\lib\security\java.policy

    Should load some CodeBase list. Click on it for edit or:

    Add Entry

    Leave CodBase blank for every location where code is running but you can put localhost or your stite if you want and signedBy blank for non signed jars/applets. Click Add Permission, then choose AllPermissions
    I have CodeBase and it java.security.AllPermission

    Then save! java.policy and should get sucess message.

    Done you can run non signed applet and acess disk files.

提交回复
热议问题