private boolean permissionsGranted() {
final SocketPermission permission = new SocketPermission(
"239.255.255.250", "connect,accept,resolve");
try {
AccessController.checkPermission(permission);
return true;
} catch (final AccessControlException e) {
try {
e.printStackTrace(new PrintStream("out2.txt"));
} catch (IOException ex) {
}
return false;
}
}
When running the above code in the Netbeans debug environment the above code returns true
but when complied to a .jar and run by simply double clicking the icon it will return false and I'm at a loss as to why.
I've tried self signing the jar but this did not help.
Verify if your machine has a firewall active, or jar permissions to executions in S.O.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With