Window 10 java is not recognized as an internal or external command, operable program or batch file

This error occurs usually when you try to compile a Java source file using javac command e.g. javac Helloworld.java and your PATH is not set properly. It means that javac.exe executable file, which exists in the bin directory of the JDK installation folder is not added to the PATH environment variable. In order to solve this error, you need to add JAVA_HOME/bin folder in your machine's PATH. Until your add Java into your system's PATH variable, you cannot compile and run Java program.

Just follow the steps given below to resolve your problem:

1) Just click on the Start button and open the command prompt and then type cmd on the run window.

2)  Type echo %PATH%,  it will now show you all the directories available in the PATH environment variable. The PATH output that you will receive, just copy it into your text editor e.g. Notepad or Word-pad and search if it contains the JDK installation directory or JAVA_HOME. Just take an example: Suppose if your JDK is installed on "c:\program files\java\jdk1.8.0", then PATH must include "c:\program files\java\jdk1.8.0\bin". It's important to include bin directory because all executable required to compile, run and debug Java program are stored in the bin directory.  Sometimes you may also see something like %JAVA_HOME%\bin , where JAVA_HOME is another user-defined environment which points to Java installation directory. 

3) If PATH doesn't contain bin directory of JDK, then you can add them into PATH by the following command

set PATH = %PATH%;"c:\program files\java\jdk1.8.0\bin

This is also called setting PATH in Java. Once PATH is set you can compile, run and monitor Java programs by using various tools that come with JDK installation.

4) Now, just run the javac command again and do not forget to close the current command prompt.  Any change in the environment variable is only available to new cmd windows.

Javac is not recognized - Quick Fix

Java is not recognized as an internal or external command ?. Here are the step by step procedure on how to reproduce the issue Java is not recognized as an internal or external command or 'javac' is not recognized as an internal or external command, operable program or batch file or 'java' is not recognized as an internal or external command, operable program or batch file. and fix the same.



Step By Step Procedure to Reproduce java is not recognized error

There could be many possibilities behind Java in not recognized error, here are the steps you can try to reproduce.

  1. On windows, Click on Start, then type cmd, and hit Enter. You will now get a command prompt screen. Type "java" or "java -version and enter", you will get Java is not recognized as an internal or external command, operable program or batch file error. This happens if the Installed java in not set properly.
  2. C:\Users\Techoral> java
    'java' is not recognized as an internal or external command, operable program or batch file.

  3. Your can also try to Run javac command to compile a java program from command line, you will get Javac is not recognized as an internal or external command ERROR if the installed java is not being set properly.
  4. C:\Users\Techoral> javac 'javac' is not recognized as an internal or external command, operable program or batch file.


Here are the steps to reslove the error:

  1. Check the Java path environment variable and makes sure that Java path is properly set.
  2. If Java Path is not set, copy the path to Java bin directory go to System Properties --> System Variables and add the java bin folder path.
  3. If you are still facing the issue, you can try reinstalling the java
  4. Before installing make sure to uninstall previously installed Java. Refer Uninstall Java on Windows or if you are using linux / ubuntu please refer Uninstall Java on linux / ubuntu
  5. Once java is completly uninstalled, download and install Oracle / OpenJDK / zulu :
      1. install openjdk on redhat
      2. install adoptopenjdk
      3. install zulu openjdk
      4. install Microsoft openjdk

More details about this Bug in OpenJDK -



Window 10 java is not recognized as an internal or external command, operable program or batch file
Window 10 java is not recognized as an internal or external command, operable program or batch file

Register for a free code camp.
email:

by Tashreef Shareef

Tashreef Shareef is a software developer turned tech writer. He discovered his interest in technology after reading a tech magazine accidentally. Now he writes about everything tech from... read more

Published on March 30, 2020

  • Java is probably one of the most popular programming languages in the world today.
  • Improper use of Java commands will not be perceived as internal or external commands, so learning the language well will mean fewer such error messages.
  • We have plenty of how-to guides and troubleshooting articles in our dedicated Java page, so take a look at it for more great guides.
  • If you simply want to read troubleshooting guides, check out our dedicated Fix page.

Window 10 java is not recognized as an internal or external command, operable program or batch file

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix various PC problems, we recommend DriverFix:
This software will keep your drivers up and running, thus keeping you safe from common computer errors and hardware failure. Check all your drivers now in 3 easy steps:

  1. Download DriverFix (verified download file).
  2. Click Start Scan to find all problematic drivers.
  3. Click Update Drivers to get new versions and avoid system malfunctionings.
  • DriverFix has been downloaded by 0 readers this month.

While trying to compile a Java program or running tools Activit BPM you may encounter the Java is not recognized as an internal or external command in Command Prompt error.

This error can occur due to multiple reasons including an incorrect path for java.exe file. Since this is a common Command Prompt error, the reasons can vary depending on the user.

If you are also experiencing this error, here are a couple of troubleshooting tips to help you resolve Java is not recognized as an internal or external command error in Windows 10.


How do I fix the unrecognized Java command error?

1. Change the system variable path

Window 10 java is not recognized as an internal or external command, operable program or batch file

  1. Press Windows Key + R to open Run.
  2. Type control and click OK to open the Control Panel.
  3. Search for Advanced System Settings.
  4. Click on View advanced system settings option.
  5. On the System Properties window, open the Advanced tab.
  6. Click the Environment Variables button.
  7. Under the System Variables section select Path.
  8. Click the Edit button.
  9. In Variable value editor, click New.
  10. Enter the following path:
    • C:Program FilesJavajdk1.7.0_72bin
  11. Click OK to save the changes.
  12. Click OK for all the open windows.
  13. Restart the command prompt and check for any improvements.

Notes:

  • Make sure you use the right version of Java. You can find the right path by navigating to:
    • C:Program FilesJava.
  • Once you have got the right version, add the bin directory to your path.
  • Do not delete any other values in the Variable path editor.

You need the latest version of Java to stay efficient, so check out this article to get it.


2. Install a compatible Java version

Window 10 java is not recognized as an internal or external command, operable program or batch file

If the issue persists, try installing the Java version that is compatible with your Windows OS.

For example, if you are using a 64-bit Windows 10, download and install the 64-bit version of Java. If you are using 32-bit Windows OS, install the 32-bit version of the program.

Several users have reported the issue to have resolved after installing the right edition of Java. Additionally, you can also install both the versions of Java to use either 32 bit or 64 bit depending on your use.

  • Download Java latest version for Windows 10 [32bit / 64bit]

If you see a message telling you what version of Java you have installed, it means that you have it.

  • Is Java free to use?

Java remains free for general-purpose computing usage and is among the best programming languages available.


The Java is not recognized as an internal or external command in Command Prompt error occurs if the environment variables are not configured correctly.

By adding the correct path to an environment variable, you can resolve the issue. If the error persists, try installing the compatible Java version.

If you know of any other solutions to this Java-related problem, leave us a message in the comments section below and we’ll update the article based on your feedback.

Window 10 java is not recognized as an internal or external command, operable program or batch file
Still having issues? Fix them with this tool:

  1. Download this PC Repair Tool rated Great on TrustPilot.com (download starts on this page).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues with Patented Technologies (Exclusive Discount for our readers).

Restoro has been downloaded by 0 readers this month.

Frequently Asked Questions

  • What is Java?

    Java is a programming language and computing platform. Plenty of tools can be used to interpret its bytecode as well.

  • How do I know if Java is installed?

    Go to Start > Programs > Accessories > Command Prompt. Type: java -version and press Enter on your keyboard.

    If you see a message telling you what version of Java you have installed, it means that you have it.

Window 10 java is not recognized as an internal or external command, operable program or batch file

Newsletter

Why is Java not showing up in Command Prompt?

when trying to run the java command, this means that there is no java command on your shell's command search path. The cause could be: you don't have a Java JRE or JDK installed at all, you have not updated the PATH environment variable (correctly) in your shell initialization file, or.

How do I set Java path in Windows 10?

Procedure.
Download or save the appropriate JDK version for Windows. ... .
Right-click the Computer icon on your desktop and select Properties..
Click Advanced system settings..
Click Environment variables..
Under User variables, click New..
Enter JAVA_HOME as the variable name..
Enter the path to the JDK as the variable value..