1

After setting up java path in environment variable option in Advanced System Setting . javac command shows "'javac' is not recognized as an internal or external command, operable program or batch file." but after executing the command

C:\java files>set path=C:\Program Files (x86)\Java\jdk1.7.0\bin

javac works but again after reopening the Command Prompt javac doesn't work. What is the problem whys is it occurring. OS Windows 10 Enterprise Java version 1.8.0_77.

P.S. java is working whereas javac is not working.

  • Double check the path you set in your user profile, there's a good chance you made a mistake there. Also try logging out and back in again; Variable changes should take effect as soon as you make them, but for some reason sometimes changes only seem to stick after logging in again. – Cubic Mar 25 '16 at 13:05
  • Try `echo %PATH%` to see if your configuration was set. – W-S Mar 25 '16 at 13:07
  • yup it showed the location to jdk1.8.0_77 folder –  Mar 25 '16 at 13:12
  • Please post the result of your `echo %PATH%` command. – W-S Mar 25 '16 at 13:49
  • Near(?) dupe of http://stackoverflow.com/questions/6523979/how-to-persistently-set-a-variable-in-windows-7-from-a-batch-file http://stackoverflow.com/questions/8358265/how-to-update-path-variable-permanently-from-cmd-windows http://superuser.com/questions/317631/setting-path-in-windows-7-command-prompt http://superuser.com/questions/390701/how-can-i-permanently-append-an-entry-into-the-systems-path-variable-via-comma ALSO Java 1.8.0_anything should install to jdk1.8.0 not jdk1.7.0 – dave_thompson_085 Mar 25 '16 at 16:00

2 Answers2

0

Check out this Oracle's tutorial

java path

ricgra
  • 1
  • 1
0

try this it might solve your problem:

 Go to MyComputer -> Properties -> Advance Systems Settings -> Environment Variables -> System Variables -> Path. In the last, give the semi column and paste your path for JDK
  • It should work. java is part of the JRE, not the JDK. You need to add the JDK bin to the system PATH, in Control Panel, System, Advanced, Environment Variables. – Mohammad Shahadat Hossain Mar 25 '16 at 13:21
  • `java` is in both JRE/bin and JDK/bin, and JRE/bin is automatically installed in PATH so `java` works, but `javac` is only in JDK/bin and so yes you need to add JDK/bin. – dave_thompson_085 Mar 25 '16 at 15:59