Reputation: 9583
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.
Upvotes: 3
Views: 67
Reputation: 48
Verify if your machine has a firewall active, or jar permissions to executions in S.O.
Upvotes: 1