javawindowsplayframework

Play framework can't find javac


I'm following a play tutorial when I run the web server before making any changes to the app. The server throws an error:

IOException: Cannot run program "javac": CreateProcess error=2, The system cannot find the file specified

I check my JAVA_HOME and it reads C:\Program Files\Java\jdk1.7.0_25. How would one fix this issue?


Solution

  • Make sure that the javac is in the OS's search path

    For example, on Windows, goto Control Panel -> System, click Advanced System Settings, click on Environment Variables.

    In the System variables, locate the variable named path and insert C:\Program Files\Java\jdk1.7.0_25\bin at the start of the value. Don't forget to add ; between the values ;)

    enter image description hereenter image description here

    Click Okay, Okay.

    Close any command prompt windows you have open and re-open them. This will ensure that they are updated with the new environment variables.