I just bought a Win 7 PC, installed jdk1.6 and Netbeans, NB works fine, but when I did "java -version" in a command prompt, it can't find java, why ? How to fix it ?

Edit : I thought the installation process should set the path correctly, how come it didn't ?

link|improve this question

80% accept rate
feedback

migrated from stackoverflow.com Aug 11 '10 at 22:32

This question came from our site for professional and enthusiast programmers.

3 Answers

The JDK installer for windows does not update the path environment variable. The installation docs describe how to do this. See item #4 on that page.

link|improve this answer
Thanks, got it. – Frank Aug 12 '10 at 3:08
feedback

The path to java isn't in your system PATH variable.

link|improve this answer
feedback

The executable probably isn't in your path. What does 'echo %PATH%' say?

link|improve this answer
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind‌​owsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\ – Frank Aug 11 '10 at 18:07
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.