Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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
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
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
problem with me is that .jar file doesn't automatically request the access only when i run it from cmd then it asks for it – Muhammad Umer May 3 '15 at 21:44

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .