Unable to resolve this error javac is not recognized as an internal or external command

28.6K    Asked by ShantellRoye in Devops , Asked on Jul 26, 2021

 I am new to Java application and having trouble compiling a simple Helloworld program. JDK 1.7.0 is installed in my Windows 7 and was able to set the path variable but didn't work. I keep getting the following error:

C:UsersIvy>cd 
C:cd java files
C:java files>set path=C:Program Files (x86)Javajdk1.7.0bin
C:java files>javac Hello.java
'javac' is not recognized as an internal or external command, operable program or batch file

Answered by Fiona Dickens

javac is not recognized as an internal or external command, is an error that 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.

Check your javac path on Windows using Windows Explorer C:Program FilesJavajdk1.7.0_02in and copy the address.

Go to Control Panel. Environment Variables and Insert the address at the beginning of var. The path followed by a semicolon. i.e C:Program FilesJavajdk1.7.0_02in; . Do not delete the path existent, just click in and go to the left end and paste the line above. Do not try anything else, because you just need to link your code to "javac.exe" and you just need to locate it.

Close your command prompt and reopen it, and write the code for compilation and execution.



Your Answer

Answers (3)

You can find the steps here - https://getlearntech.com/fix-for-javac-is-not-recognized-as-an-internal/

4 Days

You can find the steps here - https://getlearntech.com/fix-for-javac-is-not-recognized-as-an-internal/

4 Days

You can find the steps here - https://getlearntech.com/fix-for-javac-is-not-recognized-as-an-internal/

4 Days

Interviews

Parent Categories