Error: JAVA_HOME is incorrectly set.

Today, there are pictures and the truth about the problems with hadoop under windows.
Insert picture description here
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:
Insert picture description here
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:
Insert picture description here
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
Insert picture description here
editing, press The key combination Ctrl+S saves, then close the file, open the command line and enter hadoop versionit again . The result is as follows: The
Insert picture description here
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.

Guess you like

Origin blog.csdn.net/weixin_43408020/article/details/113871762