What can I do when I keep receiving the error
\'javac\' is not recognized as an internal or external command, operable program or batch file
This just means that javac isn't in your PATH variable.
On Windows, you just have to add the folder that contains javac.exe to the PATH environment variable (Win+Pause/Break).
On Linux/Mac/Unix, just append that directory to $PATH in .bashrc or similar.
The error that you are seeing is generated by Windows, and isn't specific to Java. That error means that you typed a command and Windows could not find the command by that name.
The easiest way of rectifying the situation is to ensure that Java is properly installed in your system's PATH
.
First, ensure that you have a JDK installed (and not just a JRE). Your next best bet is to add an environment variable called JAVA_HOME
and point it at the base install directory for the version of Java that you installed.
Next, modify your PATH
environment variable by prepending the string %JAVA_HOME%\bin;
to whatever is already in your PATH
. If you look at the contents of that directory, you will see that javac
is in there (along with a number of other Java development tools).
You have to install JDK (which includes javac compiler) and ensure that it's in the path. See http://java.sun.com/javase/downloads/index.jsp
For Windows
Control Panel > System...Then click Advanced System Setting (left pane)...then popup window will open...then click Environment Variables...Then another window will open...click New and add enter information below
Variable name: PATH
Variable value: C:\Program Files\Java\jdk1.7.0_45\bin [*make sure this is the right path for you]
Then it should work