Hadoop Command Not Found: Verify the Install Before Editing PATH

A `hadoop: command not found` message usually means the shell cannot locate Hadoop’s command script. Verify the distribution itself before permanently editing PATH.

Apache HadoopHadoop 3.x · Unix-like shellsLast reviewed Sep 25, 2026
🎯 You’re likely in the right place if:
Running `hadoop` returns “command not found” or similar.You downloaded or unpacked Hadoop but the shell cannot invoke it by name.You are using a Unix-like shell such as bash, zsh or WSL.
Difficulty: Easy–ModerateRisk: Low first
🔎 Quick Check — run Hadoop from its own directory

Change to the Hadoop distribution directory and invoke the bundled command directly. This separates an installation problem from a PATH problem.

cd /path/to/hadoop ./bin/hadoop version

Verify: If Hadoop prints its version, the installation is reachable and PATH is the remaining issue.

Did Hadoop run from ./bin/hadoop?
ADSENSE · reserved slot after the first useful step

Why this happens

Apache Hadoop commands are provided by scripts in the distribution’s `bin` directory. The shell can only resolve `hadoop` by name when that directory is on PATH. Hadoop also uses `HADOOP_HOME` as its home-directory environment variable.

Diagnose before changing more

1
Does ./bin/hadoop version work?
If yes, keep the installation and fix environment variables instead of reinstalling Hadoop.
2
Is HADOOP_HOME the actual distribution root?
It should point to the directory that contains bin, etc and other Hadoop directories.
3
Does Java fail after Hadoop is found?
That is a different stage: command discovery succeeded, so troubleshoot Java/Hadoop configuration separately.

Fix #2 — set HADOOP_HOME and PATH for the current shell

Point `HADOOP_HOME` to the real Hadoop installation and prepend its `bin` directory to PATH. Use your actual installation path.

export HADOOP_HOME=/path/to/hadoop export PATH="$HADOOP_HOME/bin:$PATH" command -v hadoop hadoop version
🟡 Before changing configuration: Test the values in the current shell first. Do not permanently save a path until it works.
Did Fix #2 work?

Fix #3 — persist the working environment

After the temporary values work, add the same exports to the startup file used by your shell, such as `~/.bashrc` or `~/.zshrc`, then open a new terminal and verify again.

hadoop version
🟡 Keep it reversible: Edit only the shell profile you actually use, and avoid duplicate or stale Hadoop paths.
Did Fix #3 work?

Still seeing the error?

If `command -v hadoop` returns a path but Hadoop itself fails, the command-not-found problem is solved. Continue with the new error message, such as Java configuration, permissions or Hadoop configuration, rather than adding more PATH entries.

Official references

Still stuck? Ask the community

Share your operating system, software version, exact error text, and which fix you already tried. Another reader may have seen the same setup.

Keep it safe: never post passwords, API keys, access tokens, recovery codes, license keys, private URLs, or confidential logs.
Powered by GitHub DiscussionsSign in with GitHub to comment. Reading comments does not require sign-in.

Loading community discussion…