0

while trying to create a web module project throwing an error

but my ENV variables and JAVA_HOME are already pointing to correct JDK folder.

enter image description here

2 Answers2

1

Try setting your JAVA_HOME path to C:\Program Files\jdk1.8.0_141\bin. I believe you need to point it to the folder the executable (java.exe) is located in.

Cyphereion
  • 71
  • 11
  • I changed it to C:\Program Files\jdk1.8.0_141\bin but still it is showing the same error. – iNeedToAskThis Aug 26 '17 at 03:22
  • go to the command prompt ( new window of command prompt) and run "echo %Path%" and see if it matches with the path you set . Does it contain "C:\Program Files\jdk1.8.0_141\bin" Ideally your JAVA_HOME should be JAVA_HOME path to C:\Program Files\jdk1.8.0_141 and your Path should be %JAVA_HOME%\bin;and the renaming path as is – Geek Aug 26 '17 at 03:38
  • Sry,but its not working either ! – iNeedToAskThis Aug 26 '17 at 03:55
  • JAVA_HOME should not point to /bin – Cortex Mar 11 '21 at 04:04
1

What I do is close to what you use, but not quite the same. I set JAVA_HOME to C:\jdk1.8.0_141 (as I install the JDK at the root C:\ rather than in program files. I don't like spaces in path names and I don't like drilling down to get to the JDK. Personal preference and should not matter.) The difference is not using \bin on the end. Then for my PATH variable, I have %JAVA_HOME%\bin;C:\WINDOWS\SYSTEM32;.... That is, tack the \bin in the PATH not the JAVA_HOME.

Capricorn1
  • 819
  • 9
  • 17
  • Yes Sure, but it is not making a difference in my system. The Path is C:\Program Files\Java\jdk1.8.0_141\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\; – iNeedToAskThis Aug 26 '17 at 04:01
  • ENV var Path --- >> %JAVA_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%MAVEN_HOME%; – iNeedToAskThis Aug 26 '17 at 04:03