This guide contains instructions to fix the error “Java is not recognized as an internal or external command”, in Windows 10/11.
The error “java is not recognized as an internal or external command, operable program or batch file”, can appear when you try to run an application packaged as a JAR file, or when you try to view the installed version of Java from the command line using the command “java – version”.
The mentioned error usually appears because there is no Java installed on your machine, or because the JAVA executable file cannot be found.
How to FIX: Java is not recognized as an internal or external command on Windows 10/11.
Method 1. Install JAVA.
The first method to fix the “java is not recognized as an internal or external command” is to download and install JAVA on your machine. If you already installed Java and you receive the error, then skip to Method-2.
Method 2. Add JAVA Path to Environment Variables.
Another cause of the Java error “java not recognized as an internal or external command”, is that system does not know where to find the Java executable file. In such a case, proceed and add the PATH of the Java executable in Environment Variables.
1. Press Windows + R keys to open the Run command box.
2. Type control sysdm.cpl and press OK (or Enter), to open the System Properties.
3. In System Properties, select the Advanced tab and then click to open the Environment Variables.
4. In System Variables section, click the Path and then click Edit.
5. In Edit Environment variable window double-click at the first empty line and then click Browse.
6. Now, according of the installed JAVA version (64bit or 32bit), navigate to one of the following paths, select the bin folder and click OK.*
- C:Program FilesJavajre-versionbin
- C:Program Files (x86)Javajre-versionbin
* Notes:
1. Where “jre-version” is the version of the installed Java. e.g.
- C:Program FilesJavajre1.8.0_361bin
- C:Program Files (x86)Javajre1.8.0_361bin
2. If you have installed Java JDK navigate to the JDK path. e.g.
- C:Program FilesJavajdk1.9.0_27bin
- C:Program Files (x86)Javajdk1.9.0_27bin
7. After adding the Java path, click OK three (3) times to close all windows.
8. Finally restart your computer to apply the change (or restart the command prompt and run your Java command again.)
Method 3. FIX “Java not recognized as command” by reinstalling Java.
If none of the above methods solved the “Java is not recognized as an internal or external command” problem, proceed to remove and reinstall Java according to the instructions below.
1. Download and run the Java Uninstall tool.
2. Choose Agree at the first screen. *
* Note: If prompted that “There is only one up-to-date Java version detected. Are you sure to continue?” click Yes.
3. Select all the installed Java versions and click Next.
4. Click Yes again to clean the cache
5. When the uninstall is completed, click the Get Java button or navigate to Java Download page to download and install the latest Java version. *
* Note: If you use 32-bit and 64-bit browsers, you will need to install both 32-bit and 64-bit Java in order to have the Java plug-in for both browsers. You can download both Java versions from here.
6. After installing Java on your system, check if the problem is solved.
That’s all folks! Which method worked for you?
Please leave a comment in the comment section below or even better: like and share this blog post in the social networks to help spread the word about this solution.