'Hadoop Streaming Job showing error /bin/java : No such file or directory

I have installed Hadoop in my Macbook M1 2020 with MacOS Monterey 12.3.1.

I am able to successfully use hadoop and hdfs commands in my Laptop. I started using hadoop streaming following the Ubuntu tutorial in this video.

First of all I opened my local hadoop directory and found hadoop-streaming.jar.
Location of Hadoop-streaming Jar file in Finder

Then I used 'hadoop jar' command to run Word count program in my Macbook but I am getting an error shown in the screenshot below. Screenshot with Hadoop-streaming error

I google this error obviously and got this stackoverflow link, to which the answer is changing JAVA_HOME path in hadoop-env.sh has already been completed by me before hadoop installation. JAVA_HOME Path in hadoop-env.sh

Edit 1: This is my .zshrc which includes correctly configured JAVA_HOME and PATH variables. Still, the error remains same.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source