[Solved] /bin/bash: /us/rbin/jdk1.8.0/bin/java: No such file or directory

Run the map reduce program and report the following error:

Container exited with a non-zero exit code 127. Error file: prelaunch.err
/bin/bash: /us/rbin/jdk1.8.0/bin/java: No such file or directory

reason:

Yan’s Java path is not configured or the wrong path is configured.

Solution:

vim hadoop/etc/hadoop/yarn-env.sh

Change Java_home to the correct path, for example:

export JAVA_HOME=/usr/bin/jdk1.8.0

The yarn-env.sh of each machine should be modified. You can also use the SCP command to synchronize the yarn-env.sh to other machines.

Suppose there are four machines C1, C2, C3 and C4, which are currently on machine C1:

cd hadoop/etc/hadoop
scp yarn-env.sh c2:/hadoop/etc/hadoop
scp yarn-env.sh c3:/hadoop/etc/hadoop
scp yarn-env.sh c4:/hadoop/etc/hadoop

*After modification, Hadoop will not take effect until it is restarted

Similar Posts: