Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have created a jar of my socket program. When I run this jar on a Windows system for the first time it asks for public and home network access. If the user grants them then it works fine and accepts requests from public user's. But if the user denies it then it only works if the firewall is turned off. I want that each time the user runs my jar it should ask for file network access permissions so that in case the user denies it for the first time he can give those permissions next time.

share|improve this question

migrated from stackoverflow.com Jun 29 '11 at 13:20

This question came from our site for professional and enthusiast programmers.

    
That's OS specific and user configuration on their machine. NO? –  The Elite Gentleman Jun 29 '11 at 10:43
    
This is a Windows Firewall setup question, not a programming question. –  THelper Jun 29 '11 at 10:43

2 Answers 2

up vote 2 down vote accepted

You can't. This behaviour depends only on the user's Windows' firewall configuration, there is nothing you can do about it in your program. Furthermore, Java isn't supposed to access such system specific details.

share|improve this answer
    
hmmm so i should provide a document along with my app that firewall should be turned off? –  Dennis Jun 29 '11 at 10:56
1  
Yes. Firewalls blocking apps is a common issue that most user know about. –  Giann Jun 29 '11 at 10:58
    
@thks..4 the info –  Dennis Jun 29 '11 at 11:30
    
No. Tell them to add the exception. Turning off the firewall is the equivalent of leaving the front door unlocked vs. giving just your app a copy of the key. –  Chris Nava Jun 29 '11 at 14:09

You can have a policy file in your jar, the policy file containing the required permissions for the application. To know more about policy files, check this link

share|improve this answer
    
@Rakesh can you provide an example like for a folder permission?how can i take that? –  Dennis Jun 29 '11 at 11:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.