Verified Fix

How to Fix Minecraft Error java.net.ConnectException

If you are encountering error java.net.ConnectException on Minecraft, this guide will help you resolve it.

Quick Summary

The "java.net.ConnectException" error in Minecraft typically indicates that your computer is unable to establish a connection with the server you are trying to join. Specifically, 'Connection refused' means the server actively refused the connection, usually indicating a problem on the server-side or a connectivity issue preventing your client from reaching it.

Common Causes

  • Server is Offline: The Minecraft server you are trying to connect to may be temporarily offline for maintenance, updates, or due to an unexpected crash. This is the most common reason you'll see this error.
  • Incorrect Server Address or Port: You might be entering the server address or port number incorrectly. A minor typo can prevent you from connecting.
  • Firewall Blocking the Connection: Your firewall or antivirus software may be blocking Minecraft from accessing the internet, preventing it from connecting to the server.
  • Network Connectivity Issues: Problems with your internet connection, such as a dropped connection or DNS issues, can prevent you from connecting to remote servers.
  • Server Whitelist Restriction: Some servers have a whitelist enabled, which only allows specific players to join. If you are not on the whitelist, you won't be able to connect.
  • Server Overload: The server might be experiencing high traffic or be overloaded, causing it to refuse new connections.

Step-by-Step Fixes

Method 1: Verify Server Status and Address

Step 1: Confirm with the server administrator or community that the server is online and running. Check any server status channels (Discord, forums, etc.).

Step 2: Double-check the server address (IP address or domain name) and port number are entered correctly in your Minecraft client. Even a single incorrect digit will prevent connection.

Method 2: Check Your Internet Connection

Step 1: Make sure you have a stable internet connection. Try browsing the web or using other online services to verify your connection is working.

Step 2: Restart your router and modem. This can often resolve temporary network connectivity issues.

Method 3: Configure Firewall/Antivirus

Step 1: Check your firewall settings (Windows Firewall, macOS Firewall, or third-party firewalls) to ensure that Minecraft (java.exe or javaw.exe) is allowed to access the internet.

Step 2: Temporarily disable your antivirus software (if applicable) to see if it is blocking the connection. If disabling the antivirus resolves the issue, configure it to allow Minecraft through.

Method 4: Check Server Whitelist

Step 1: If you suspect the server has a whitelist, contact the server administrator and ask to be added to the whitelist.

Step 2: Provide the administrator with your Minecraft username.

Method 5: Try a Different Server

Step 1: Attempt to connect to a different Minecraft server. If you can connect to other servers, the problem is likely with the specific server you were initially trying to join.

Method 6: Flush DNS Cache

Step 1: Open Command Prompt (Windows) or Terminal (macOS, Linux).

Step 2: Type ipconfig /flushdns (Windows). Or sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder (macOS). Press Enter.

Step 3: Restart your computer.

Download Repair Tool →