javajavapolicy

Java 8 Windows permissions


I am trying to add the following permissions in my java.policy file:

permission java.net.SocketPermission "127.0.0.1:1024-", "accept,connect,listen,resolve";

permission java.net.SocketPermission "127.0.0.1:28080”, "accept,connect,listen,resolve";

But I got the error:

java.security.policy: error parsing file:/C:/Program%20Files%20(x86)/Java/jre1.8.0_191/lib/security/java.policy:
    line 50: expected [;], found [accept]

Does something changed in Java 8, is the syntax different?


Solution

  • If you notice, you have used ” instead of ", just after 28080. Change it to " and this should hopefully work!