1

I'm preparing a VM with Windows XP, Java 4 and Java 8 for university projects purposes.

Before installing Java4 I first installed 7 and 8 for gradle, intellij and some other projects.

After all the installation stuff, i set my JAVA_HOME variable to

C:\Developer\SDK\Java\j2sdk1.4.2_19

and added JAVA_HOME\bin to the PATH variable.

It should all work fine, but when I opened CMD and issued

java -version

java 8 version is printed. On the other hand, javac -version prints nothing but the help dialog.

Am I doing anything wrong?

Images

enter image description here

enter image description here

vzamanillo
  • 9,905
  • 1
  • 36
  • 56
RecuencoJones
  • 2,747
  • 3
  • 22
  • 21
  • It needs to be `%JAVA_HOME%\bin`. It also might need to be first in the list in your path. – ratherblue Apr 13 '15 at 16:29
  • ok, I had it in the format you said (I do know the syntax, have worked with variables a lot), but placing it first solved it somehow, thank you very much. – RecuencoJones Apr 13 '15 at 18:38
  • Next time you can try using the `where` command to know which java executable you are actually running (`whereis` on *nix envmts) – Claudio Apr 13 '15 at 18:39
  • I did know where they were actually and somehow `where` isn't working on my VM – RecuencoJones Apr 13 '15 at 18:43

1 Answers1

2

As @sev said, placing it first in the path variable solved the issue

RecuencoJones
  • 2,747
  • 3
  • 22
  • 21