Article directory
Summarize :
报错 : Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd
JDK is installed in the C:\Program Files\ directory, and the installation directory Program Files has spaces, which is too pitiful;
Change to a JDK directory without spaces;
1. Error message
Install the Hadoop runtime environment,
After completing the above installation steps, run the hadoop command and report an error;
C:\Windows\system32>hadoop -version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
Please update D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd
‘-Xmx512m’ is not recognized as an internal or external command,
operable program or batch file.
The error message is as follows:
C:\Windows\system32>hadoop -version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
Please update D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd
'-Xmx512m' is not recognized as an internal or external command,
operable program or batch file.
C:\Windows\system32>hadoop -version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
Please update D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd
'-Xmx512m' is not recognized as an internal or external command,
operable program or batch file.
2. Problem analysis
Core error message:
Error: JAVA_HOME is incorrectly set.
Please update D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd
That is the JAVA_HOME setting error in the D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd file;
The settings are as follows:
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_91
The problem lies in this path, which is the actual path of JDK;
But there is a space in the path, which leads to an error when running Hadoop;
3. Solutions
Change to a JDK without spaces:
set JAVA_HOME=D:\001_Develop\031_Java8u144_Frida\jdk1.8.0_144
run again
hadoop -version
command, at this time Hadoop runs successfully;
C:\Windows\system32>hadoop -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) Client VM (build 25.144-b01, mixed mode)
run
hadoop
command, can run correctly;
C:\Windows\system32>hadoop
Usage: hadoop [--config confdir] [--loglevel loglevel] COMMAND
where COMMAND is one of:
fs run a generic filesystem user client
version print the version
jar <jar> run a jar file
note: please use "yarn jar" to launch
YARN applications, not this command.
checknative [-a|-h] check native hadoop and compression libraries availability
conftest validate configuration XML files
distch path:owner:group:permisson
distributed metadata changer
distcp <srcurl> <desturl> copy file or directories recursively
archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive
classpath prints the class path needed to get the
Hadoop jar and the required libraries
credential interact with credential providers
jnipath prints the java.library.path
kerbname show auth_to_local principal conversion
kdiag diagnose kerberos problems
key manage keys via the KeyProvider
trace view and modify Hadoop tracing settings
daemonlog get/set the log level for each daemon
or
CLASSNAME run the class named CLASSNAME
Most commands print help when invoked w/o parameters.