-1

i made a simple java file with extension .java and i have also set javac path variable C:\Program Files\Java\jdk1.7.0_25\bin but it's not working and giving message "javac is not recognized as an internal or external command , operable program or batch file " .i also closed cmd and reopen than also not worked .

john
  • 337
  • 2
  • 15

3 Answers3

0

Make sure that you launch a new console after adding the jdk/bin directory to PATH. An open console will not automatically refresh itself with any environment variable changes.

Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136
0

Would suggest to do following:

  1. Go to path C:\Program Files\Java\jdk1.7.0_25\bin, run javac.
  2. If javac runs after going to path check PATH environment variable, go to command prompt type PATH and press enter, make sure java bin path is there.
  3. If you dont see java bin in previous step, edit PATH environment variable.

Cheers !!

Sachin Thapa
  • 3,559
  • 4
  • 24
  • 42
  • javac runs but in few secoends terminates . and when i enter PATH in cmd than path of javac is not shown and also i used "SET PATH =% C:\Program Files\Java\jdk1.7.0_25\bin %" (without quotes ) to set path . in opened cmd when i entered PATH than show javac path but when i closed cmd and reopen cmd and entered PATH than did not show javac path . – john Aug 25 '13 at 05:59
  • To set path, right click on My Computer or go to system in control panel and click on Advanced tab. Depending on version of your windows this might be little different. – Sachin Thapa Aug 25 '13 at 20:27
  • ya i have done and also there is already path for javac is available . – john Aug 31 '13 at 15:11
0

When you are setting path variable, the already opened command prompt can not get the updated/changed path value automatically so you need to close previously opened command prompt and open a new one. Moreover if you are setting the path value(Any environment value) from command prompt, it is limited to currently opened command window. Once you are closing this cmd prompt and opening it again there is no path value available for new command prompt. So its better to set path value by going to system properties and create/change environment variable.

Shailesh Saxena
  • 3,472
  • 2
  • 18
  • 28