How to configure Windows Defender Firewall on both Windows 10 and Windows 11 to allow your Java-based application and its port to work correctly.
General Considerations
Port Number: You'll need to know the specific port your application uses for communication. If you don't, check the application's documentation or settings. For OmniPACS Router the port needed is 7775
Administrator Privileges: You'll likely need administrator access to make these changes.
Windows 10
Open Windows Defender Firewall
Search for "Windows Defender Firewall" in the Start menu and click on it.Advanced Settings:
In the left-hand menu, click on "Advanced Settings."Inbound Rules:
In the left-hand menu, click on "Inbound Rules."New Rule:
In the right-hand actions pane, click on "New Rule."Rule Type:
Select "Port" and click "Next."
Protocol and Ports:
Choose whether your application uses TCP or UDP (consult your application documentation).
βUnder "Specific local ports," enter the port number your application uses.
βClick "Next."
Action:
Select "Allow the connection" and click "Next."
Profile:
Choose the profiles to which this rule should apply (Domain, Private, Public, or any combination)
Click "Next."
Name:
Provide a descriptive name for your rule (e.g., "[Application Name] Inbound Rule") and click "Finish."
Windows 11
The process is very similar to Windows 10:
Open Windows Defender Firewall:
Search for "Windows Defender Firewall" in the Start menu and click on it.
Advanced Settings: Same as Windows 10.
Inbound/Outbound Rules: The rest of the process is identical to the steps for Windows 10, focusing on creating a new Inbound Rule.
Additional Tips
Java Executable: If you're having trouble, consider adding the Java executable itself (java.exe or javaw.exe) to the list of Allowed Apps instead of just specifying the port. This is sometimes a broader solution.
Application-Specific Guidance: Check your application's documentation for any specific firewall configuration recommendations.
Important Security Notice: Remember that opening up ports in your firewall does introduce some security risk.
Make sure you trust the application and limit the scope of the rule (e.g., only applying to the private network) whenever possible.