1

I am getting the below error in Windows 10 even though I have configured JAVA_HOME to the correct directory I believe. I know that there are similar questions but none of them seem to have a clear resolution for resolving this on windows 10.

Error:

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

JAVA_HOME Variable: enter image description here Contents of JDK Folder: enter image description here

Verifying variable in CMD:

enter image description here

steelthunder
  • 438
  • 2
  • 12
  • 27
  • 2
    You have a ``\\`` before the `:` in `C:\Program Files` – Elliott Frisch May 31 '18 at 19:24
  • Hint: when using strings that mean a path, you can always take that string into a command line shell and check if it is really valid. Your path is obviously broken. – GhostCat May 31 '18 at 19:27
  • Corrected the root directory to C:\ (which I am sure I had correct in my initial attempts). I am still getting the same error. Also verified variable via CMD. – steelthunder May 31 '18 at 19:30
  • Try logging off or rebooting. Also try unsetting all JAVA_HOME at system and user level. – rustyx May 31 '18 at 19:53

3 Answers3

0

You are missing the bin directory in your jdk home directory. The bin folder is where all the good stuff is like the compiler and much more.

codemonkey
  • 1,213
  • 2
  • 14
  • 31
  • Yes, I thought that was suspicious. I had originally downloaded Java SE 10.0.01 but just tried Java SE 8U172 which contained the bin directory and worked. – steelthunder May 31 '18 at 19:46
0

I had originally downloaded Java SE 10.0.01 which for some reason did not contain a bin directory. Just tried Java SE 8U172 which contained the bin directory and worked.

steelthunder
  • 438
  • 2
  • 12
  • 27
-1

You can try setting system 'Path' variable with \bin added like this "%JAVA_HOME%\bin". Or edit the JAVA_HOME variable to include \bin.

MrKat86
  • 1
  • 1