If you encounter the error “JAVA_HOME is incorrectly set” when running Hadoop on Windows, it means that the JAVA_HOME environment variable is not properly configured.
To fix this issue, follow these steps:
- Open Control Panel and navigate to System and Security > System > Advanced system settings.
- Click on Environment Variables button at the bottom of the window.
- Under System Variables section, scroll down and locate the JAVA_HOME variable.
- If JAVA_HOME does not exist, click on New button and add a new system variable with name JAVA_HOME and value as the path to your Java installation directory (e.g., C:\Program Files\Java\jdk1.8.0_191).
- If JAVA_HOME already exists but points to an incorrect location, update its value to point to the correct Java installation directory.
- Click OK to close all windows.
Once you have properly configured the JAVA_HOME environment variable, try running Hadoop again. The error should be resolved now.