Wednesday, January 16, 2013

Set PATH to JDK on Windows 8 (official version)

Last post described how to "Download and Install JDK 7 on Windows 8 (Official version)".

After downloaded and install JDK 7 on Windows 8, now open a Command Prompt window to run java or javac...!!!

you can optionally set PATH environment variable to JDK so that you can conveniently run the JDK executable files (javac.exe, java.exe, javadoc.exe, and so forth) from any directory without having to type the full path of the command.

To set path, search "Environment Variables" in "Settings", click "Edit the system environment variables".

Click "Environment Variables".

Select System variables of Path, and click Edit...

Add the location of the bin folder of the JDK installation, in my case it is "D:\Program Files\Java\jdk1.7.0_11\bin".

Now, you can close and re-open Command Prompt window, type java and javac to varify your setting.

18 comments:

  1. as you shown in your screen shots, I've tried the commands, and when I executed the "where java" command it just showed me "C:\Windows\System32\java.exe" and no other...
    I also tried the execution of "where javac" and it has shown me "INFO:Could not find files for the given pattern(s)"
    I've installed the latest version of java, i.e jdk 1.7.0_17
    Please help me.

    ReplyDelete
  2. The javac is not found again!!

    ReplyDelete
    Replies
    1. i will tell you why.. because where you see This
      [D:\Program Files\Java\jdk1.7.0_11\bin]
      it will not work.. because java always goes in [C:\]
      So what doe's it mean's ? it means that you have to use This
      [C:\Program Files\Java\jdk1.7.0_11\bin]
      if this will not work then go to C:\program files\java and find it and paste in cmd
      Thanks for Your Antention..
      And Remember Run "CMD" always with "Administrator Right's"

      Delete
  3. i have window 8.1. So this will working?

    ReplyDelete
    Replies
    1. hello,

      In my own case, I'm running Windows 8.1 Pro now, it's OK. But somebody commented still not working!

      Delete
    2. This comment has been removed by the author.

      Delete
  4. i installed and followed your step. it still not working. same thing said INFO:Could not find files for the given pattern(s).

    ReplyDelete
  5. hey
    i m using windows 8.1 in this PATH variable is already occupied by NVIDIA Graphic drivers so if i edit this variable with java is it possible that my graphic card will not work??

    ReplyDelete
    Replies
    1. You are not replace the original PATH, is to EDIT by adding to the end of original PATH:
      ;D:\Program Files\Java\jdk1.7.0_11\bin

      depends on your installed path

      Delete
    2. I just replaced my entire directory with C:\Program Files (x86)\Java\jdk1.8.0_20\bin how do I retrieve the original dircetory and fix this?

      Delete
    3. i have done the same but no effect on NVIDIA graphics card or other. everything seems to run fine.

      Delete
  6. Your tips helped me make this work after searching all over the place to no avail, so thank you VERY much for your post!!

    ReplyDelete
  7. thank you very much, it worked flawlessly

    ReplyDelete
  8. hey..i really need your help. how tho change "c:\Windows\system32>" to "c:\User\Admin>" that comes out at the first line of the cmd? please help me :"(

    ReplyDelete
  9. For me its not working yet i changed the path and i cant compile it can u help me?

    ReplyDelete
  10. Is it possible to append the path for java.exe from within a batch file? Ie., just add it on through a batch file rather than having to change each computer's settings?

    ReplyDelete