Fix Java Error – ‘Javac is not recognized as an internal or external command, operable program or batch file.’0
June 5, 2013 by Abhay
Java is a very popular programming language and is gaining a lot of attention by the budding Android programmers. Java beginner’s programming tutorial requires you to download the Java JDK software bundle, followed by writing the source code of the ‘HelloWorld’ program in Notepad and compiling it in a terminal window.
But most users face problem in the compiling step and it gives an error – ‘Javac is not recognized as an internal or external command, operable program or batch file‘.
To fix this Java error, just follow these simple steps–
1. Open Control Panel and type ‘Environment Variables‘ in the search bar. Click on ‘Edit the system environment variables‘.
Open My Computer and right-click to select Properties. Now click on ‘Advanced System Settings‘ from the left-side menu.
2. Click on the ‘Environment Variables‘ button.
3. Under the System Variables, go to ‘Path variable‘ and press Edit.
4. Find the location of the ‘Javac‘ file using Windows Explorer search and copy the path.
E.g. C:\Program Files\Java\jdk1.6.0_24\bin
5. In the Variable Value section, paste the location of the Javac file in the beginning of all values followed by a semicolon (;), without erasing the previous values.
E.g. C:\Program Files\Java\jdk1.6.0_24\bin;
6. Close the command prompt or terminal window, re-open it and re-write the code for compilation and execution.
Now, you have successfully provided a path for Javac and your program will run without giving any errors. In case, you still get errors, check your coding.
I hope this post helped you out, keep following for more.