Play framework can't find javac
Asked Answered
H

4

25

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?

Hexagon answered 27/8, 2013 at 1:56 Comment(0)
S
43

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.

Stative answered 27/8, 2013 at 2:0 Comment(3)
Just a small correction: one should add C:\Program Files\Java\jdk1.7.0_25\bin to the path, not C:\Program Files\Java\jdk1.7.0_25.Enenstein
did everything, still facing the same issue :(Rhabdomancy
Lol. It also helps to actually install the JDK too.Ossetia
C
4

I wasn't aware that the typical java install DOES NOT have javac. Thus, I did the following:

1) Visited the Java SE Development Kit site

2) Downloaded the version for my Operating System and installed it

3) went to the root folder of the newly Java SE Development Kit (in this case C:\Program Files (x86)\Java\jdk1.8.0_31\bin)

4)Using the windows search, entered environment variables, which brings up the option Edit the system environment variables on Windows 7

5) clicked on Environment Variables in the System Properties tab that should have opened.

6) with PATH highlighted, clicked Edit...

7) Added ;(a semi-colon to seperate this new path from the old) + C:\Program Files (x86)\Java\jdk1.8.0_31\bin (make sure there is no space between the semi-colon and the new path.

Carnet answered 20/2, 2015 at 18:6 Comment(0)
B
0

Don't forget to check your system access. You should have all access power during the instalation or setting process. I just had to require full OS access (Windows, in the big company) to solve this issue and now it's all ok.

Bennett answered 20/1, 2014 at 17:8 Comment(0)
H
0

Even though you might have the JDK bin directory in your PATH environment variable, this problem can occur. To fix it, put the path of JDK bin directory (not the JRE one) at the beginning of the PATH variable, just in case javac is getting picked up in the wrong directory because the wrong directory happens to be first.

Heimlich answered 28/11, 2014 at 10:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.