Search code examples
javapathjavac

JDK, javac not recognized


I've recently installed java and have added it to my PATH Variables on my Windows 10 machine.

JDK in the System Path Variables JDK in the System Path Variables

However I receive the error that javac is not present in the directory when trying to compile my program. This is probably a simple question but the other answers I have found are for people who don`t have the path at all.

Error of no javac

Error of no javac

I would appreciate any and all help you can provide.


Solution

  • You need to add the path of your JDK to the Path variable not in the variable Java Developement Kit.

    You can also reference other variables in your path variable:

    |----------------------|-----------------------|
    | Variable             | Value                 |
    ------------------------------------------------
    | JAVA_HOME            | C:\Program...         |
    ------------------------------------------------
    | Path                 | ...%JAVA_HOME%\bin;.. |
    ------------------------------------------------