5

I downgraded java 1.7 from 1.8, but I still see 1.8 when I do java -version. I changed the path and also made JAVA_HOME changed for 1.7 as

JAVA_HOME: C:\Program Files (x86)\Java\jdk1.7.0_79 
PATH:      C:\Program Files(x86)\Java\jdk1.7.0_79\bin

For some reason I also have this in my path: C:\ProgramData\Oracle\Java\javapath, which I believe keeps this 1.8 version. When I take off this from the path, I get this message: C:\Program Files\Java\jre7\lib\amd64\jvm.cfg. I don't know what's going on. Any suggestion would be very helpful.

Rookie_Guy
  • 82
  • 2
  • 10
  • I may be wrong on this, but I think "java -version" gives you the runtime version (i.e., the JRE version) and not the JDK. – Mage Xy Sep 04 '15 at 21:06
  • What is in your C:\ProgramData\Oracle\Java\javapath folder? – Evan LaHurd Sep 04 '15 at 21:16
  • java.exe, javaw.exe and javaws.exe – Rookie_Guy Sep 04 '15 at 21:21
  • 2
    If your question accurately reflects your PATH and JAVA_HOME, I think you'll see the error in the now-formatted details above... – TallTed Sep 04 '15 at 21:28
  • 1
    How did you “downgrade“? With Java its not enough to just install java7. You have to deinstall Java8 as well. This is because you can have installed different versions of Java at the same time. – Matthias Wimmer Sep 04 '15 at 21:51
  • @TallTed, you are right. I meant to say JAVA_HOME: C:\Program Files (x86)\Java\jdk1.7.0_79; \bin accidentally added. Thank you for correcting. – Rookie_Guy Sep 04 '15 at 22:10
  • I also see a missing space in the `PATH` value. I see you also have a mix of 32-bit (in the `JAVA_HOME` and `PATH` values) and 64-bit (from your partial error message) components, and that may be contributing to your struggle. I think you need to review and/or provide the complete output of `set` and of `java -version` to make progress. – TallTed Sep 04 '15 at 22:20

3 Answers3

4

TRY DOING THE FOLLOWING:

Type "regedit" from startup menu. Take a back up if you are a novice.
Go to "HKEY_LOCAL_MACHINE->SOFTWARE->JavaSoft->Java Runtime Environment"
Double click on "CurrentVersion" on the right side of the panel
Change version to "1.7".


If you have "C:\ProgramData\Oracle\Java\javapath" in your path variable . Then open the
location and make sure the java.exe file points to respective 1.7 directory.
Vivek Agrawal
  • 581
  • 9
  • 21
1

If you have "C:\ProgramData\Oracle\Java\javapath" in your path variable, bring your JAVA_HOME/bin path before it.

Ex: C:\Program Files(x86)\Java\jdk1.7.0_79\bin;C:\ProgramData\Oracle\Java\javapath.

I faced the similar issue and was not able to downgrade the java version from 1.8 to 1.7.

Piyush Upadhyay
  • 399
  • 3
  • 11
-4

close your MS-DOS and open a new MS-DOS window. try again.

user3892260
  • 851
  • 2
  • 9
  • 17