0

So I find myself kind of stuck in between.

I set JAVA_HOME to C:\Program Files\Java\jdk1.8.0_121 then Maven works but

java -version

shows 'java' is not recognized as an internal or external command, operable program or batch file.

If I set JAVA_HOME to C:\Program Files\Java\jdk1.8.0_121\bin, Maven doesn't work but at least I get java -version right.

I'm pretty sure I'm doing something fundamentally wrong but I can't put my finger on it, obviously :(

Ascendant
  • 827
  • 2
  • 16
  • 34
  • 2
    `java -version` will look at your $PATH, so normally we need to add %JAVA_HOME%/bin to $PATH for any ad-hoc command. For maven, internally it checks $JAVA_HOME/bin. Hope it helps. – sayboras Nov 15 '17 at 02:19
  • @Apolozeus Your comment solved my issue. Make it an answer, I will accept it as one. – Ascendant Nov 15 '17 at 02:52

1 Answers1

1

java -version will look at your $PATH, so normally we need to add %JAVA_HOME%/bin to $PATH for any ad-hoc command. For maven, internally it checks $JAVA_HOME/bin. Hope it helps.

sayboras
  • 4,897
  • 2
  • 22
  • 40