Javac Command Not Found
Javac command is usually used to check whether the Java is installed in our system or not. When the Java is not installed in our system and we try to run Javac command, we get Javac command not found or Java is not Recognized. We can also get this error when Java is installed in our system but the path is not added to the system’s environment variable.
Javac command is used to compile our java program. When the compiler doesn’t find the javac.exe file, our command prompt shows the Javac Command Not Found or path is not recognized error.
Resolve Javac Command Not Found Error
In order to solve this issue, we first have to installed Java or jdk in our system. If the jdk is already installed in our system, we have to add the path variable into our system’s environment variable. This path is basically is the location of that folder where the java.exe file is present. So, it is required to add the bin directory because java.exe file is available in bin folder.
In our system, the path of the bit folder is as follows:
In order to set the path to the environment variable, we have two options. The first option is to set the path temporary and another one is to set the path permanently.
- We go to the command prompt and type the following command and press the enter key. Once you press the enter key, the path is set to the specified location. After running this command, we can compile and run the java program.
- If we want to set the path permanently, we have to follow the following steps:
- We go to the advance system setting by clicking on the Advance system settings option of our system.
- When we click on the Advance system settings, a dialog box will be open. From this popup, we click on the Environment Variables.
- When we click on the Environment Variables, a new dialog popup for setting path permanently. We will click on the New button to set path and for that it open New User Variable dialog.
- We give variable name Path and path of the bin directory of JDK folder will be the value of it. We create a new user variable only when there is not path variable. If it already exists, we edit it and add path value to that variable.
- If the path variable is already exists, we select the Path variable and click on the Edit
- When we click on the Edit button, it will open a new dialog and from that dialog we click on the New button to add path of the bin directory and click on the Ok
- We go to the advance system setting by clicking on the Advance system settings option of our system.