简体   繁体   English

Windows 防火墙不允许 Java 应用程序

[英]Windows Firewall Not Allowing Java Application

I have a Windows PC which is running a standalone Java application which requires internet access.我有一台运行需要 Internet 访问的独立 Java 应用程序的 Windows PC。 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.为了限制来自其他应用程序(如 Windows Update、Anti Virus 等)的数据使用,PC 已经设置了 Windows 防火墙,并且只允许出站连接到特定的白名单应用程序。

I currently have listed: DNS on UDP port 53 Java.exe and Javaw.exe我目前已列出:UDP 端口 53 Java.exe 和 Javaw.exe 上的 DNS

However when I run the Java application I am getting the following stack error...但是,当我运行 Java 应用程序时,出现以下堆栈错误...

java.net.SocketException: Permission denied: connect java.net.SocketException:权限被拒绝:连接

My understanding that white listing Java.exe would allow internet access to the Java Application, but this does not work.我的理解是,将 Java.exe 列入白名单将允许 Internet 访问 Java 应用程序,但这不起作用。

Any idea why?知道为什么吗?

Not the java.exe connects .jar files to the internet, but the javaw.exe does.不是 java.exe 将 .jar 文件连接到互联网,但 javaw.exe 可以。

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:为了允许我的 MyApp.jar 应用程序在 Windows Defender 防火墙中传出连接,它为我添加了 javaw.exe 的规则,如下所示:

Windows Defender Outbound rule for Java .jar Applications Java .jar 应用程序的 Windows Defender 出站规则

看起来您需要以管理员模式运行 Java 应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM