Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Javac" doesn't work correctly on Windows 10

the problem is that I upgraded to Windows 10 and now I'm installing my tools to programming and now that I installed the JDK 7 of Java, when I try to use in the cmd the command: - "javac"

The result of this is: "javac" is not recognized as an internal or external command...

But I was edited the PATH with the correct link of jdk, because when I use "java", it is ok.

Now, I tried in the console with this command: PATH=%PATH%;"C:\Program Files\Java\jdk1.7.0_79\bin"

And when I executed the command "javac" it works, but now, when I open other console, it doesn't work, or when I restart the console, this command is not recognized.

What could be the problem?

like image 948
Sadôk Avatar asked Aug 10 '15 17:08

Sadôk


People also ask

Why my javac is not working?

javac is not recognized is an error occurs while we compile the Java application. It is because the JVM is unable to find the javac.exe file. The javac.exe file is located in the bin folder of the JDK. The reason behind to occur the error is that the PATH is not added to the System's environment variable.

Why javac is not recognized in CMD?

It means that the javac.exe executable file, which exists in the bin directory of the JDK installation folder is not added to the PATH environment variable. You need to add the JAVA_HOME/bin folder in your machine's PATH to solve this error.


2 Answers

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"

like image 112
SLaks Avatar answered Oct 17 '22 21:10

SLaks


Her's how I configure System variable on Windows 10 :

enter image description here

like image 29
Mahesh Sonavane Avatar answered Oct 17 '22 20:10

Mahesh Sonavane