---
title: "How to fix the \"Connection Refused\" error on a Java server"
icon: lucide/network
description: "How to resolve the 'Connection Refused: getsockopt' error on a Java server by combining the IP and port correctly in the Minecraft client."
---

# How to fix the "Connection Refused" error on a Java server

The message _"Connection Refused: getsockopt"_ usually appears when the Minecraft client cannot reach the server. On a Java server, the most common cause is that the client has not combined the server address with the port.

## Steps

1. Open the panel and copy your server's **Address/IP** and **Port**.
2. Combine them into the `ip:port` format, for example `hu-tao.nexuscloud.id:12345`, then copy it.
3. Open Minecraft, go to the **Servers** list, then **Edit** your server.
4. Remove the old address, then paste the `ip:port` string you copied.
5. Click **Done**, then try to join again.

## Notes

- The port used in the client must match the port shown in the panel exactly. If the panel shows `12345`, enter `hu-tao.nexuscloud.id:12345`, not just `12345`.
- If it still fails, make sure the server is online in the panel and that no firewall is blocking the connection from the player's side.

---

!!! tip "Help us out"
    If you found this tutorial useful, please leave a review on [Trustpilot](https://www.trustpilot.com/evaluate/nexuscloud.id)! Your rating helps us make more useful guides :sparkles:

**Cheers, Team NexusCloud**

---
