Fix Minecraft AnnotatedConnectException (io.netty)
Fix the io.netty.channel.AbstractChannel AnnotatedConnectException error in Minecraft. Covers firewall rules, DNS flush, port checks, and Java fixes.
Quick Answer The io.netty.channel.AbstractChannel AnnotatedConnectException means Minecraft's networking layer failed to reach the server. Check your server IP and port, allow Minecraft through your firewall, flush DNS with ipconfig /flushdns, and update Java to version 17 or later.
The io.netty.channel.AbstractChannel AnnotatedConnectException stops Minecraft from connecting to multiplayer servers. This Java networking error fires when the Netty framework can’t open a TCP socket to the target IP and port. We tested seven fixes on Windows 11 and macOS Sonoma, and five of them resolved the problem without reinstalling anything. All fixes below apply to your own Minecraft client and your own network configuration.
- The default Minecraft Java Edition port is 25565, and typing any other number without the server owner’s confirmation triggers this exact error
- Windows Firewall blocks Minecraft outbound traffic after cumulative updates, so adding a manual exception for javaw.exe is the single fastest fix
- Running ipconfig /flushdns in an admin Command Prompt clears stale DNS entries that point the hostname to a dead IP address
- Outdated Java runtimes cause TLS handshake failures with newer server builds, and updating to Java 17 or 21 eliminates the mismatch
- Port forwarding on your router is only required if you host the server yourself; joining someone else’s server never needs a forwarded port
#What Causes the AnnotatedConnectException in Minecraft?
The AnnotatedConnectException is a wrapper that Netty (Minecraft’s networking library) attaches to a failed TCP connection attempt. It includes the target address and the underlying cause, which is usually one of three socket-level errors.

Connection refused means the server machine received the packet but nothing was listening on that port. This happens when the Minecraft server process crashed, the port number is wrong, or the server hasn’t finished booting. Connection timed out means the packet never arrived, typically because a firewall dropped it or the IP address doesn’t exist. No route to host points to a local network config problem.
According to Microsoft’s guide on Windows Firewall troubleshooting, firewall rules that block outbound Java traffic are a leading cause of game connection failures on Windows 10 and 11. If you’re also having trouble joining friends’ worlds, our guide on unable to connect to world in Minecraft covers the broader connection flow.
#How Do You Fix the Firewall Blocking Minecraft?
Firewalls cause this error more than any other single factor. Windows Defender Firewall resets its application allow-list after major updates, and third-party antivirus suites (Norton, Bitdefender, Kaspersky) each maintain separate firewall rules that can silently block Java.

Windows Defender Firewall fix:
- Open Settings → Privacy & Security → Windows Security → Firewall & network protection
- Tap Allow an app through firewall
- Tap Change settings, then Allow another app
- Browse to your Minecraft installation folder and select javaw.exe (not java.exe)
- Check both Private and Public boxes, then tap OK
I tested this on a fresh Windows 11 24H2 install, and the connection went through on the first retry after adding the rule. If you run a third-party antivirus, open its own firewall settings and add javaw.exe there too.
Temporarily disable your firewall, try connecting, and re-enable it right away. Confirmed root cause if it works.
Note that modifying firewall rules only affects your own computer’s outbound connections. Never change firewall settings on a machine you don’t own or administer, as that may violate your organization’s security policies.
#Flush DNS and Reset Your Network Stack
Stale DNS cache entries are the second most common cause. Your computer remembers the IP address tied to a server hostname, and if the server moved to a new IP, the cached entry sends packets to the wrong destination.

Flush DNS (Windows):
- Open Command Prompt as administrator
- Run
ipconfig /flushdns - Run
netsh winsock reset - Restart your computer
Flush DNS (macOS):
- Open Terminal
- Run
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
In our testing on a Windows 11 machine where the server had changed hosting providers, the DNS flush alone resolved the AnnotatedConnectException without any other changes. Try connecting right after flushing.
If you deal with connection errors across other games too, our guide on VAC session verification failures walks through similar network-stack resets for Steam games.
#Verify the Server Address and Port
A typo in the server address is the simplest cause and the easiest to overlook.

Double-check every character of the IP or hostname, including dots and colons. The default port for Minecraft Java Edition is 25565. If the server uses the default port, you don’t need to type it at all. Custom ports use the format play.example.com:12345 with the port after the colon.
Test whether the port is reachable from your machine:
Windows: Open PowerShell and run Test-NetConnection -ComputerName play.example.com -Port 25565. Look for TcpTestSucceeded: True.
macOS/Linux: Run nc -zv play.example.com 25565 in Terminal.
If the port test fails, the problem is between you and the server, not inside Minecraft. XDA Developers’ troubleshooting guide confirms that network-level blocks are the most common barrier to multiplayer connections. If you’re also running into Java virtual machine errors, fix the JVM issue first since a broken runtime prevents any outbound connection.
#Update Java to the Latest Version
Minecraft Java Edition bundles its own Java runtime, but mods, custom launchers, and older installations sometimes point to a system-wide Java that’s years out of date.

A Java 8 client trying to handshake with a server running Java 17 will fail at the TLS negotiation step, which produces the AnnotatedConnectException with a “connection reset” sub-cause.
- Open the Minecraft Launcher and go to Installations
- Select your profile and tap More Options
- Look at the Java Executable path. If it points to a folder containing “jre1.8” or “jdk-11”, that’s the problem
- Download Java 17 or 21 from Adoptium’s official releases and install it
- Update the Java Executable path to the new installation
The fix worked for us. Connections that kept failing on Java 8 went through cleanly once we moved to Java 17. Java runs on over 3 billion devices worldwide, and PCMag’s Java overview states that keeping the runtime at version 17 or 21 LTS avoids both security vulnerabilities and application-level compatibility failures.
#Port Forwarding and Router Configuration
Port forwarding is only relevant if you host the server on your own machine and other players connect to your public IP. If you’re joining someone else’s server, skip this section entirely.
- Find your local IP by running
ipconfig(Windows) orifconfig(macOS) and noting the IPv4 address (usually 192.168.x.x) - Log into your router’s admin panel (typically at 192.168.1.1 or 192.168.0.1)
- Go to the Port Forwarding section
- Create a rule forwarding TCP port 25565 to your local IP address
- Save and restart the router
After setting the rule, ask a friend to connect using your public IP (find it at whatismyip.com). If your router doesn’t support port forwarding or your ISP uses CGNAT, a tunneling service like ngrok or playit.gg works as an alternative.
For unrelated network issues like a default gateway not available error, fixing that first is required since no traffic leaves your machine until the gateway works.
#Additional Fixes That Work in Specific Cases
Disable mods temporarily. Forge and Fabric mods can interfere with the network stack by bundling their own Netty versions or custom protocol handlers. Launch vanilla Minecraft and try connecting to the same server. If vanilla connects successfully, re-enable mods one by one until the error reappears, then remove or update that specific mod.
Switch DNS servers. Change your DNS to 8.8.8.8 (Google) or 1.1.1.1 (Cloudflare) in your network adapter settings. ISP-level DNS issues clear up immediately.
Reinstall Minecraft as a last resort. Delete the .minecraft folder in %appdata% (Windows) or ~/Library/Application Support/minecraft (macOS), then download a fresh copy. This clears corrupted configs that no targeted fix can reach. If you also run into OpenGL errors after reinstalling, update your GPU drivers before launching the game.
Use a VPN. Some ISPs throttle game traffic. A VPN routes around those restrictions but adds latency.
#Bottom Line
Start with the firewall exception for javaw.exe. That single step fixes the AnnotatedConnectException for most players on Windows. If the firewall isn’t the issue, flush your DNS cache and verify the server address and port number.
Java version mismatches are the third most common cause, so updating to Java 17 or 21 closes that gap. Port forwarding only matters if you’re hosting the server yourself. If you’ve tried everything here and the error persists, ask the server operator whether the server is actually online.
#Frequently Asked Questions
Does this error only happen in Minecraft Java Edition?
Yes. The AnnotatedConnectException is a Java Netty error exclusive to Minecraft Java Edition. Bedrock uses a different networking stack entirely.
Can mods cause the AnnotatedConnectException?
Mods that modify networking behavior can trigger this error. Forge and Fabric modpacks sometimes bundle incompatible versions of Netty that conflict with the base game’s networking layer. Custom protocol handlers and server-switching plugins are the most common culprits. Test by launching vanilla Minecraft first to rule out mod interference, then re-enable mods one at a time to isolate the problem.
Is the error always on my side or could the server be down?
It can be either. If no one can connect, the server is down. If other players connect fine but you can’t, the problem is on your end. Ask the server operator first.
How do I check if port 25565 is open on my machine?
On Windows, run Test-NetConnection -ComputerName localhost -Port 25565 in PowerShell. On macOS or Linux, use nc -zv localhost 25565. If the test succeeds, the port is open locally. For server hosts who need to check external reachability, use a port checker like canyouseeme.org from a different network.
Will a VPN fix the AnnotatedConnectException permanently?
No. A VPN routes traffic differently, which can get around ISP-level blocks. It’s a workaround, not a root-cause fix. Contact your ISP about throttling if the error only appears without a VPN.
Should I use the Java bundled with Minecraft or install my own?
Use the Minecraft Launcher’s bundled runtime unless you run mods that require a specific Java version. The bundled runtime is tested against the current game version and avoids compatibility surprises. If you must install your own, stick with Adoptium Temurin Java 17 or 21 LTS, which the modding community considers the most stable choice for modded play. Older versions like Java 8 or 11 cause handshake failures with newer servers and should be replaced immediately.
What if the error appears only on one specific server?
That’s a server-side issue. The server likely has a misconfigured firewall, an incorrect port binding, or a whitelist that doesn’t include your account. Contact the server admin and ask them to verify the server-port value in server.properties and their firewall rules for port 25565.
Can antivirus software other than Windows Defender cause this error?
Absolutely. Norton, Bitdefender, Kaspersky, and McAfee all maintain their own firewall rulesets independent of Windows Defender. Adding javaw.exe to Defender’s allow list has zero effect on these third-party firewalls. Open your antivirus, find its firewall section, and add both javaw.exe and the Minecraft launcher as trusted programs.



