Today, there are pictures and the truth about the problems with hadoop under windows.
I also fell into the pit at the beginning, but fortunately there is Baidu, I dare to summarize the article of the big guy.
Analyze the problem, the reason is that hadoop is not configured with a Java environment (JDK).
First, we need to install Java, I have already installed it, mine is Java12. The directory I installed is not the default C drive, and the JDK directory is the superior directory of the bin directory where java.exe is located, as shown in the following figure:
Then, according to the error message, we go to the G drive to find the hadoop-env.cmd file, as shown in the figure below:
we can use Edit with any editor. I use IE here. After we enter, press the key combination Ctrl+F to find the content JAVA_HOME, locate the location of JAVA_HOME, set JAVA_HOME to the absolute path of the previous JDK directory, as shown below: After
editing, press The key combination Ctrl+S saves, then close the file, open the command line and enter hadoop version
it again . The result is as follows: The
result is no error, and the hadoop version number appears, which proves that the JDK, that is, JAVA_HOME, is successfully set.
In fact, this is also due to an article by a big brother, the link address . I wish everyone a smooth solution to the problem. Finally, thank you all for coming to watch my article. There may be many improprieties in the article, and I hope to point out He Haihan.