Issue
The system cannot find the path specified.
JAVA HOME is not set correctly.
I am getting the following error when I try to run web server in Eclipse:
The system cannot find the path specified. JAVA HOME is not set correctly.
But checking my env variables they look correct:
echo %JAVA_HOME%
C:\Program Files (x86)\Java\jdk1.8.0_101
echo %PATH%
C:\ProgramData\Oracle\Java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;C:\Program Files\Git\cmd;C:\HashiCorp\Vagrant\bin;C:\Installation;C:\Program Files (x86)\Brackets\command;C:\Program Files (x86)\Java\jdk1.8.0_101\bin;C:\ProgramData\Oracle\Java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;C:\Program Files\Git\cmd;C:\HashiCorp\Vagrant\bin;C:\Installation;C:\Program Files (x86)\Brackets\command;C:\Program Files (x86)\Java\jdk1.8.0_101\bin;C:\ProgramData\Oracle\Java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;C:\Program Files\Git\cmd;C:\HashiCorp\Vagrant\bin;C:\Installation;C:\Program Files (x86)\Brackets\command;
Is there something else I'm missing?
Solution
Check for system environment variables and user environment variables... seems like eclipse is taking variables from different environment..
If problem persist then set the JAVA_HOME in eclipse to tell eclipse explicitly where java is installed in the system. To set JAVA_HOME in eclispe few options given below.
To set JAVA_HOME in eclipse navigate to windows menu -> preferences -> Add runtime variables
OR
Navigate to Run menu -> External Tools configurations -> Navigate to environment tab -> Add JAVA_HOME variable and it's path as it's value to set environment variable in eclipse.
Answered By - himeshc_IB