Reputation: 365
So I've downloaded the latest JDK and installed it. I'm starting to go through a textbook with some tutorials but in no part of the textbook do they tell you how to 'setup' the javac compiler. If I type 'javac' into the command line it simply says it is not a recognised command. I have added the path of the bin folder to the path environment variable but it still says not a recognised command. Please help!!
Upvotes: 0
Views: 12125
Reputation: 66
Javac is sitting in the bin directory contained in the area where your java compiler and interpreter were installed. So, assuming the path to bin is C:.....\bin, type set path=%path%;C:.....\bin at the command prompt.
Upvotes: 0
Reputation: 13191
Did you happen to modify PATH variable through command set PATH=%PATH%;C:\path\to\java\
? If so, the PATH variable is not permanently stored yet. Use setx PATH "%PATH%;C:\path\to\java\"
instead, and check if it was added by echo %PATH%
, and check again in new cmd window. I had almost the same problem; I don't know the difference between set and setx, but the former didn't work for me, too :).
Upvotes: 0
Reputation: 21
javac
works from within its folder.echo %JAVA_HOME%
and make sure it points to the right folder.echo %PATH%
and make sure it includes the right path.Upvotes: 0