javac command not found
Solution 1:
It looks like the javac
executable cannot be found because you did not set your PATH
environment variable to include it. This is a simple fix.
Since you are clearly using Windows XP...
- Right click "My Computer" and select "Properties". (or Win + Pause)
- Go to the "Advanced" Tab
- Click the "Environment Variables" button near the bottom of the dialog
- Under "User variables" for your account, there should be a
PATH
variable, if there is not click "New" and create it with the variable namePATH
and the value as the path to your jdk'sbin
directory (something likeC:\Program Files\Java\jdk1.6.0\bin
, it is different between installations so you will have to checkC:\Program Files\Java
for a jdk version). If it already exists but is empty, change it to the path to your jdk'sbin
directory. If it already exists but is NOT empty, append a semicolon (;
) along with the path to your jdk'sbin
directory.
The value should look like this:
If there were previous values, it should be separated with a semicolon like so:
Solution 2:
First check if you still have the java compiler on your computer.
Open a command prompt and type
cd \
dir javac* /s
If it didn't find any files, install the JDK to compile your java program.
Solution 3:
You need to edit the environment variables, as mentioned by John T. The built in windows environment variable editor is kind of a pain, check out Rapid Environment Editor.