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

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:\Users\Ivy>cd \
C:\cd java files
C:\java files>set path=C:Program Files (x86)\Java\jdk1.7.0\bin
C:\java files>javac Hello.java
'javac' is not recognized as an internal or external command, operable program or batch file

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @sarfaraz_k

    Thank you for reaching out to us.

    The path looks incorrect. You missed the '\' character after C:. It should be:

    set PATH=C:\Program Files (x86)\Java\jdk1.7.0\bin;%PATH%

    Then, you can verify it with the where command.

    C:\Users\U8009686>where javac
    C:\Program Files\Java\jdk-11.0.11\bin\javac.exe

Answers