4

I am using Windows 7 and 8 in my PC . I have installed jdk 7 and created class path for bin as it should be. But when I enter javac in the command prompt, it throws an error:

 `javac is not recognizing as internal and external`.

I have searched for a solution in many websites but nothing could solve my problem. Would you please help me and suggest where my mistake could be?

user2729614
  • 41
  • 1
  • 2
  • 1
    You need to provide bin path to system `path` variable. After doing that, did you close and then start the command prompt? Try doing that. I remember it solved the same issue for me a while ago – Prasad Kharkar Aug 29 '13 at 14:30
  • Have you tried restarting console? Also do you mean `path` or `CLASSPATH`? – Pshemo Aug 29 '13 at 14:31
  • _created class path for bin_ No, you need to add the path to Java's bin folder to your system properties. – Sotirios Delimanolis Aug 29 '13 at 14:31
  • [Refer](http://stackoverflow.com/questions/7709041/javac-is-not-recognized-as-an-internal-or-external-command-operable-program-or) – thar45 Aug 29 '13 at 14:32
  • http://www.java-forums.org/other-ides/46248-javac-not-recognized-internal-external-command-error.html http://www.coderanch.com/t/519460/java/java/javac-recognized-internal-external-command Please try to research your query before posting it on stack overflow good sir. – Ben Dale Aug 29 '13 at 14:43

4 Answers4

5

You need to set the environmental variables. Run sysdm.cpl from run dialog box to open advanced system properties.

enter image description here

In the environmental variables, add a new one like in this dialog.

enter image description here

Name :  JAVA_HOME
VALUE:  C:\Program Files\Java\jdk1.7.0_21\

Now edit the value of the PATH variable and add ;%JAVA_HOME%\bin\; at the end of it's value.

enter image description here

Now, restart your system and you can run java related commands from command prompt.

Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91
0

also set path in your *System variables:path=c:/..../jdk/bin/;c:/..../JRE/bin;.;

user Variables:CLASSPATH=c:/..../jdk/bin/;c:/..../JRE/bin;.;

KhAn SaAb
  • 5,248
  • 5
  • 31
  • 52
0

It is path not classpath - -till your bin folder and restart cmd

Prasad Kharkar
  • 13,410
  • 5
  • 37
  • 56
0

Double check your system variable "Path" on System Properties appending %PATH_TO_JDK%\bin. Don't forget to restart the command prompt after.

pfurtado
  • 1
  • 1