1

My intention is to do a bit of modding of Minecraft using MCP. For that, my Java JDK needs to be specified in the system PATH and working. Unfortunately, it isn't working as typing "java -version" returns the version I use for running Minecraft (JRE7), not the one I've specified in the PATH (JDK6). (Note: JDK6 is supposedly what's needed for this, and the JRE obviously wouldn't work for development anyway.)

Here's my full PATH:

C:\Program Files\Java\jdk1.6.0_45\bin;C:\Program Files (x86)\OpenVPN\bin;C:\Program Files (x86)\Google\google_appengine\

The specified JAVA_HOME:

C:\Program Files\Java\jdk1.6.0_45

And here's the result of "java -version", even after a full system restart since installing the JDK and setting the PATH:

java version "1.7.0_45"

java(TM) SE Runtime Environment (build 1.7.0_45-b18)

java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

Help would be massively appreciated, thanks!

asked Mar 9, 2014 at 21:41
5
  • try where java.exe. windows usually has a java.exe in the system directory. Commented Mar 9, 2014 at 21:45
  • 1
    The Windows installer has a very annoying habit: it puts a java.exe and javaw.exe into Windows\System32 so the last installed JDK will always be the first on the path. I usually delete those file right after installatioin Commented Mar 9, 2014 at 21:45
  • That did it a_horse_with_no_name! Since I can't answer my own question you may as well do so and I can pick it out as the correct answer :) Commented Mar 9, 2014 at 21:51
  • 1
    Adding onto @a_horse_with_no_name 's comment, the java.exe and javaw.exe files will also be in your sysWOW64 folder, I am unsure if that would cause issue but it may be good to know. Commented Mar 9, 2014 at 21:52
  • Uninstall the jre from control panel. Commented Mar 9, 2014 at 21:53

1 Answer 1

1

x_a_horse_with_no_name's comment got it! I simply renamed java.exe and javaw.exe in C:\Windows\System32 (& in \SysWOW64), thereby forcing Windows to instead read from the PATH. My guess is that the JDK6 install refused to overwrite the JRE7 files as they were newer or something. Regardless, problem solved, thanks!

answered Mar 10, 2014 at 14:36
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.