Javac is not recognized as internal or external command [closed]

8

I'm trying to compile a class in java via the command line (cmd), however I can not, the error shown is:

  

'java is not recognized as an internal or external command, operable program or batch file.

Image of the prompt with the error:

I configured the environment variables as follows:

JAVA_HOME: C:\Program Files\Java\jdk1.8.0_60

and

PATH:
C:\ProgramData\Oracle\Java\javapath;
C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files\Windows Live\Shared;
C:\Users\AppData\Local\Smartbar\Application\;
C:\Users\AppData\Local\Smartbar\Application\;
C:\Users\AppData\Local\Smartbar\Application\;
C:\Program Files\Skype\Phone\
    
asked by anonymous 12.09.2015 / 20:47

1 answer

11
  • Right click on "My Computer" and then properties.
  • On the "Advanced" tab, click "Environment Variables".
  • Under "System Variables" click on "New ...", it will open a little window to you ...
  • Under "Variable Name" type "JAVA_HOME"
  • In the "Variable Value" type the path where you installed the JDK there from above ... in your case "C: \ Program Files \ Java \ jdk1.8.0_60". Ready, OK ...
  • Now in "User Variables" look for a variable called "PATH", if it does not exist click "New ...", otherwise click "Edit ..."
  • Who clicked "New ..." put the text as "Variable Name" "PATH" and as its value the text "% JAVA_HOME% \ bin
  • Who clicked "Edit ..." add at the end of the variable value the text "; % JAVA_HOME% \ bin"
  • Open a new command prompt and run javac
  • 12.09.2015 / 23:11