Skip to main content
← All Guides
Troubleshooting · 7 min read

How to Fix Java Not Found in Minecraft

Fix 'Java not found' or 'Unable to locate Java' errors in Minecraft. Covers installing Java 21, setting JAVA_HOME, and configuring launcher paths for 1.21+.

How to Fix Java Not Found in Minecraft

The Error

Unable to locate a Java Runtime
Error: could not find java.dll
'java' is not recognized as an internal or external command
No suitable Java installation found

This error appears when the Minecraft launcher or a server start script cannot find a Java installation. The official Minecraft launcher bundles Java, but third-party launchers and dedicated servers require Java to be installed separately. Minecraft 1.21+ requires Java 21.

Quick Fix

Download and install Java 21 from Adoptium (Eclipse Temurin). Choose the installer for your operating system (Windows x64, macOS, or Linux). After installing, restart your launcher or terminal.

Step-by-Step Fix

  1. Check if Java is installed. Open a terminal or command prompt and run java -version. If you get "not recognized" or "command not found", Java is not installed or not in your PATH.
  2. Download Java 21. Go to adoptium.net and download Temurin 21 LTS. Choose the JDK (not JRE) installer for your OS and architecture (x64 for most systems, aarch64 for ARM Macs).
  3. Install Java.
    • Windows: Run the .msi installer. Check the option to set JAVA_HOME during installation.
    • macOS: Run the .pkg installer. Java is installed to /Library/Java/JavaVirtualMachines/.
    • Linux (Debian/Ubuntu): sudo apt install temurin-21-jdk or download the .tar.gz and extract it.
  4. Set the Java path in your launcher. In Prism Launcher: Settings, Java, set "Java path" to the installed location. In MultiMC: Settings, Java, browse to the javaw executable. Common paths:
    • Windows: C:\Program Files\Eclipse Adoptium\jdk-21\bin\javaw.exe
    • macOS: /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/bin/java
    • Linux: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java
  5. Set JAVA_HOME (for servers). On Windows, go to System Properties, Environment Variables, and add JAVA_HOME pointing to the JDK root (e.g., C:\Program Files\Eclipse Adoptium\jdk-21). On Linux, add export JAVA_HOME=/usr/lib/jvm/temurin-21-jdk-amd64 to ~/.bashrc.
  6. Verify installation. Open a new terminal and run java -version. You should see openjdk version "21" (or similar).

Common Causes

  • Java not installed. The operating system does not come with Java pre-installed (except some Linux distributions).
  • Java not in PATH. Java is installed but the system PATH does not include the Java bin directory. The installer usually handles this, but manual installations require manual PATH configuration.
  • Multiple Java versions. If Java 8 and 21 are both installed, the system might use Java 8 by default. Set the path explicitly in your launcher or start script.
  • 32-bit Java on 64-bit OS. 32-bit Java limits memory to ~1.5 GB, which is insufficient. Always install 64-bit Java on a 64-bit operating system.
  • Launcher ignoring system Java. The official launcher bundles its own Java runtime and ignores system installations. Third-party launchers use the system Java.

FAQ

Does the official Minecraft launcher need separate Java?

No. The official launcher includes its own Java runtime. However, third-party launchers (Prism, MultiMC, ATLauncher) and dedicated servers require a separate Java installation.

Can I have multiple Java versions installed?

Yes. You can install Java 8, 17, and 21 side by side. Set the Java path in each launcher profile or start script to use the correct version for each Minecraft version.

What is the difference between JDK and JRE?

JRE (Java Runtime Environment) runs Java applications. JDK (Java Development Kit) includes the JRE plus development tools. Either works for Minecraft, but JDK is recommended for servers because it includes diagnostic tools like jstack and jmap.

Java Distributions Compared

Multiple organizations distribute Java 21. All are functionally equivalent for Minecraft, but there are practical differences:

  • Eclipse Temurin (Adoptium): The most recommended for Minecraft. Free, well-maintained, and available on all platforms with straightforward installers. This is what most guides reference.
  • Amazon Corretto: Amazon's distribution of OpenJDK. Free and well-maintained. Commonly pre-installed on AWS instances.
  • Azul Zulu: Another reliable free distribution. Offers builds for architectures that other distributions do not always cover (like ARM32 for Raspberry Pi).
  • GraalVM: Includes an optimizing JIT compiler that can improve Minecraft performance by 5-15% in some workloads. More complex to set up but worth testing for high-traffic servers.
  • Oracle JDK: Oracle's distribution requires a license for commercial use. For Minecraft servers, Oracle OpenJDK (free) or Temurin is preferred.

For most Minecraft servers and clients, Eclipse Temurin is the best default choice. It is free, has no licensing restrictions, and provides consistent builds across all platforms.

Need a server that handles all this? Astroworld Hosting, NVMe SSDs, Pterodactyl panel, DDoS protection on every plan.

Related Tools & Resources

🔧

Minecraft Tools

Calculators, generators & server tools

🧱

Item Database

Browse all Minecraft items, stats & recipes

⚒️

Crafting Recipes

Visual crafting guides for every recipe