'java' is not recognized / java: command not found
Before any Minecraft error can happen, the startup script must find a Java binary. 'java: command not found' (Linux) or not recognized (Windows) means the shell couldn't locate one: no runtime installed, PATH missing the bin directory, or JAVA_HOME pointing at a folder that no longer exists.
Fastest path: paste your crash report into the Crash Doctor — it identifies this pattern and 40+ others automatically. No signup.
How to fix it
- 1
Check what the shell sees
Run java -version from the server's working directory. If that works but the panel Start fails, the panel's environment differs from your shell — check its runtime setting.
- 2
Use the host's runtime picker
On CoalHosting, Settings → Runtime selects the Java major per server — no manual PATH management. Pick the version the pack needs and restart.
- 3
Self-hosted: fix JAVA_HOME and PATH
JAVA_HOME must point at the JDK root and PATH must include $JAVA_HOME/bin. After changes, open a fresh shell so the environment reloads.
- 4
Check the startup script for absolute paths
Scripts that hardcode /usr/lib/jvm/... break when a runtime updates. Prefer PATH lookup or a versioned symlink you control.
Alternative causes
These can produce the same error message — worth ruling out if the steps above don't resolve it.
Runtime removed by an OS update
Distro upgrades can remove or replace JDKs. Reinstall the runtime, or better, adopt a version manager so updates never surprise the server.
Wrong-architecture Java
An ARM machine with an x86 binary (or vice versa) fails exec — the error sometimes looks like 'not found' though the file exists.
Frequently asked
Which Java does my Minecraft version need?
1.7–1.12 → Java 8. 1.13–1.16 → Java 8/11. 1.17–1.20.4 → Java 17. 1.20.5+ → Java 21. The pack's documentation wins if it states a specific requirement.
Can I keep multiple Java versions installed?
Yes — that's the normal setup. Each server picks its own; they don't conflict as long as each startup resolves the right one.
Want this auto-fixed on your server?
CoalHosting's Minecraft hosting runs the same pattern database against every crash and applies the known fix before your players notice. Free crash diagnosis works on any server, hosted or not.
Related crashes
java.lang.UnsupportedClassVersionError
Fix the Minecraft server UnsupportedClassVersionError crash — the Java runtime is newer or older than the mod …
Server exited with code 1
Exit code 1 means the JVM hit an unhandled error. The code itself says nothing — the real cause is in the log …
Last reviewed 2026-09-06. If a step is wrong or out of date, tell us — we'll fix the article and the auto-pattern at the same time.