-1

My path variable is:

C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin;C:\Program Files\Java\jdk1.8.0_60\jre\bin

When I give the command javac t.java, it says javac is not a recognized command.

I have jdk installed.

LBes
  • 3,366
  • 1
  • 32
  • 66
  • 1
    possible duplicate of [javac is not recognized as an internal or external command, operable program or batch file](http://stackoverflow.com/questions/7709041/javac-is-not-recognized-as-an-internal-or-external-command-operable-program-or) – bluefog Aug 23 '15 at 13:32

1 Answers1

0

I don't see the jdk\bin in your path, that may explain why it's not recognised as a command. You should have in your path something like:

C:\Program Files\Java\jdk1.7.0_02\bin

So you have to edit your path. To do so: Go to Control Panel then Environment Variables and insert the path of your jdk/bin to the path.

Path is an environment variable. Environment variables are the variables containing the values related to the current environment, like the OS. One of the most famous environment variable is the Path. It contains the directories in which executable programs are located on the machine. Therefore when using a command line, the system will check the path for that command line. Now imagine your executable program is not in the Path, you would have to type in the whole path to your executable file every time (something like C:/.../.../.../mycommand) and you kind of want to avoid that. If your executable program is in the path then you don't have to worry about and you can simply type in mycommand and it will be found.

For more explanations on that I would advise not to ask SO. Such a question probably belongs to SuperUser but this very short explanation should probably help.

LBes
  • 3,366
  • 1
  • 32
  • 66
  • can u please explain the whole concept of path variables? why is it used? – user3767383 Aug 23 '15 at 13:30
  • @user3767383 I added some explanations then, but then again something very short as such a question is probably considered as off-topic. It is also a very simplified explanations, I'm not going through the whole concept here and through all environment variables either. Hope it's a good enough explanation for you. – LBes Aug 23 '15 at 13:37
  • ya, i just wanted the basic idea. – user3767383 Aug 23 '15 at 13:39