-1

I have a Windows PC which is running a standalone Java application which requires internet access. To limit data usage from other applications (like Windows Update, Anti Virus, etc...), the PC has been setup with Windows Firewall, and to only allow outbound connections to specific white listed applications.

I currently have listed: DNS on UDP port 53 Java.exe and Javaw.exe

However when I run the Java application I am getting the following stack error...

java.net.SocketException: Permission denied: connect

My understanding that white listing Java.exe would allow internet access to the Java Application, but this does not work.

Any idea why?

Dr Party
  • 13
  • 1
  • 1
  • 2

2 Answers2

0

Not the java.exe connects .jar files to the internet, but the javaw.exe does.

To allow my MyApp.jar application outgoing connections in the windows defender firewall it worked for me to add the rule for javaw.exe like this:

Windows Defender Outbound rule for Java .jar Applications

-1

Looks like you need to run the Java app in administrator mode.

jpllosa
  • 2,066
  • 1
  • 28
  • 30
  • Doesn't seem to work. I can add tcp port 443 which the Java application is trying to use and this works fine, but I don't want this as it will allow all applications to use this port. – Dr Party Oct 22 '17 at 21:06
  • tcp port 443 is an internet standard HTTPS port. As your exception states "Permission denied" then the problem has something to do when you open the UDP port 53. Perhaps try opening a non-internet standard port number. – jpllosa Oct 23 '17 at 13:39