Fix 6 min read
'java' is not recognized as an internal or external command: how to fix it on Windows
'java' is not recognized as an internal or external command: Windows पर इसे कैसे ठीक करें
By the ToolsBharat teamPublished 30 Oct 2026How we check
Applies to Oracle JDK (Java SE Development Kit) 25.0.5.0 (released 11 Sept 2026)
Quick answer
Windows can't find java.exe: either Java isn't installed, or its folder isn't in the PATH system variable. Install Java from the official source (a JDK from Oracle or Microsoft, or java.com for just running apps), then open a new Command Prompt and run java -version. If it's still not recognized, add the JDK's bin folder, by default C:\Program Files\Java\jdk-25\bin for Oracle JDK 25, to PATH under Advanced system settings → Environment Variables.
What the message means
Command Prompt can only run java if it finds java.exe in one of the folders listed in the PATH system variable. "Not recognized" means it looked and found nothing: Java isn't installed, it's installed somewhere PATH doesn't point to, or the Command Prompt window was opened before Java was installed. PowerShell reports the same problem as "The term 'java' is not recognized as the name of a cmdlet", and the fix is the same.
Step 1: install Java from the official source
Pick the kind you need:
- To write or compile Java code (college courses, projects, IDEs), install a JDK. Oracle's Windows installer needs administrator rights and installs JDK 25 by default to
C:\Program Files\Java\jdk-25. Oracle says it also copiesjava.exe,javaw.exe,javac.exeandjshell.exetoC:\Program Files\Common Files\Oracle\Java\javapath, and that you can run them directly from the JDK'sbinfolder. See our Oracle JDK listing. - Microsoft Build of OpenJDK is another official, free JDK. Microsoft says its Windows EXE installer automatically makes the JDK tools available in PATH (the default FeatureEnvironment option). On Windows 10 or later you can also run
winget install Microsoft.OpenJDK.25. If you use Microsoft's ZIP package instead, you extract it and set the variables yourself. See our Microsoft Build of OpenJDK listing. - To only run a Java program on a home PC, java.com's download is the official end-user route: see our Java for desktops listing.
Avoid "Java download" mirror sites; Oracle, Microsoft and java.com are the sources.
Step 2: open a new Command Prompt and test
Close every open Command Prompt window. java.com's instruction after any PATH change is to reopen Command Prompt. Open a new one and type java -version. If a version prints, you're done.
Step 3: add Java to PATH yourself
If it's still not recognized, add the JDK's bin folder to PATH. java.com's steps for Windows:
- Search for System (Control Panel) and select it.
- Click the Advanced system settings link.
- Click Environment Variables. Under System Variables, select PATH and click Edit. If PATH doesn't exist, click New.
- Add the JDK's bin folder, for example
C:\Program Files\Java\jdk-25\binfor Oracle JDK 25 (check the exact folder name in File Explorer). - Click OK, close all the remaining windows with OK, then reopen Command Prompt and run
java -versionagain.
java.com notes these instructions are meant for advanced users and that changing the system PATH usually isn't necessary on Windows, because the installers handle it.
If that didn't work
java -versionshows 1.8.0 instead of 25. Oracle documents this: if you install JDK 25 and then JRE 8, thejavapathentry sits before the JDK 25 location in the path. Oracle calls it a bug in the JRE 8 installer; the fix is to uninstall and reinstall JDK 25.javacisn't recognized butjavais. You probably installed only the java.com runtime.javaccomes with a JDK; Oracle's JDK installer copiesjavac.exeintojavapath.- A new JDK won't install after an old one was removed. Oracle says failed uninstalls can leave registry entries behind and recommends Microsoft's Program Install and Uninstall troubleshooter.
हिंदी में
'java' is not recognized as an internal or external command: Windows पर इसे कैसे ठीक करें
Windows को java.exe नहीं मिल रहा: या तो Java इंस्टॉल नहीं है, या उसका फ़ोल्डर PATH system variable में नहीं है। आधिकारिक स्रोत से Java इंस्टॉल करें (Oracle या Microsoft का JDK, या सिर्फ़ ऐप चलाने के लिए java.com), फिर नया Command Prompt खोलकर java -version चलाएँ। फिर भी not recognized आए, तो JDK का bin फ़ोल्डर, Oracle JDK 25 के लिए default रूप से C:\Program Files\Java\jdk-25\bin, Advanced system settings → Environment Variables में PATH में जोड़ें।
इस मैसेज का मतलब
Command Prompt java तभी चला सकता है जब उसे PATH system variable में दिए किसी फ़ोल्डर में java.exe मिले। "Not recognized" का मतलब है उसने खोजा और कुछ नहीं मिला: Java इंस्टॉल नहीं है, ऐसी जगह इंस्टॉल है जहाँ PATH इशारा नहीं करता, या Command Prompt की विंडो Java इंस्टॉल होने से पहले खोली गई थी। PowerShell यही समस्या "The term 'java' is not recognized as the name of a cmdlet" के रूप में दिखाता है, और समाधान भी वही है।
स्टेप 1: आधिकारिक स्रोत से Java इंस्टॉल करें
अपनी ज़रूरत के हिसाब से चुनें:
- Java कोड लिखने या compile करने के लिए (कॉलेज कोर्स, प्रोजेक्ट, IDE) JDK इंस्टॉल करें। Oracle के Windows इंस्टॉलर को administrator अधिकार चाहिए और यह JDK 25 को default रूप से
C:\Program Files\Java\jdk-25में इंस्टॉल करता है। Oracle कहता है कि यहjava.exe,javaw.exe,javac.exeऔरjshell.exeकोC:\Program Files\Common Files\Oracle\Java\javapathमें भी कॉपी करता है, और आप इन्हें सीधे JDK केbinफ़ोल्डर से भी चला सकते हैं। हमारी Oracle JDK लिस्टिंग देखें। - Microsoft Build of OpenJDK एक और आधिकारिक, फ़्री JDK है। Microsoft कहता है कि इसका Windows EXE इंस्टॉलर JDK tools को अपने-आप PATH में उपलब्ध कराता है (default FeatureEnvironment विकल्प)। Windows 10 या नए पर आप
winget install Microsoft.OpenJDK.25भी चला सकते हैं। अगर Microsoft का ZIP पैकेज लें, तो उसे extract करके variables ख़ुद सेट करने होंगे। हमारी Microsoft Build of OpenJDK लिस्टिंग देखें। - सिर्फ़ कोई Java प्रोग्राम चलाने के लिए घर के PC पर java.com का डाउनलोड आधिकारिक रास्ता है: हमारी Java for desktops लिस्टिंग देखें।
"Java download" वाली mirror साइटों से बचें; स्रोत Oracle, Microsoft और java.com ही हैं।
स्टेप 2: नया Command Prompt खोलकर टेस्ट करें
खुली हुई सारी Command Prompt विंडो बंद करें। PATH बदलने के बाद java.com का निर्देश है कि Command Prompt दोबारा खोलें। नई विंडो खोलकर java -version लिखें। वर्ज़न दिख जाए, तो काम हो गया।
स्टेप 3: Java को ख़ुद PATH में जोड़ें
फिर भी not recognized आए, तो JDK का bin फ़ोल्डर PATH में जोड़ें। Windows के लिए java.com के स्टेप:
- System (Control Panel) खोजें और उसे चुनें।
- Advanced system settings लिंक पर क्लिक करें।
- Environment Variables पर क्लिक करें। System Variables में PATH चुनें और Edit पर क्लिक करें। PATH न हो, तो New पर क्लिक करें।
- JDK का bin फ़ोल्डर जोड़ें, जैसे Oracle JDK 25 के लिए
C:\Program Files\Java\jdk-25\bin(फ़ोल्डर का सही नाम File Explorer में देख लें)। - OK करें, बाक़ी सारी विंडो OK से बंद करें, फिर Command Prompt दोबारा खोलकर फिर से
java -versionचलाएँ।
java.com बताता है कि ये निर्देश advanced users के लिए हैं और Windows पर system PATH बदलना आमतौर पर ज़रूरी नहीं होता, क्योंकि इंस्टॉलर यह ख़ुद कर देते हैं।
इससे भी ठीक न हो तो
java -versionमें 25 की जगह 1.8.0 दिखे। Oracle इसे दर्ज करता है: अगर आप JDK 25 के बाद JRE 8 इंस्टॉल करें, तो path मेंjavapathवाली एंट्री JDK 25 की जगह से पहले आ जाती है। Oracle इसे JRE 8 इंस्टॉलर का bug बताता है; समाधान है JDK 25 को uninstall करके दोबारा इंस्टॉल करना।javaचलता है परjavacnot recognized है। शायद आपने सिर्फ़ java.com वाला runtime इंस्टॉल किया है।javacJDK के साथ आता है; Oracle का JDK इंस्टॉलरjavac.exeकोjavapathमें कॉपी करता है।- पुराना JDK हटाने के बाद नया इंस्टॉल नहीं हो रहा। Oracle कहता है कि अधूरे uninstall से registry में एंट्री बची रह सकती हैं, और Microsoft के Program Install and Uninstall troubleshooter की सलाह देता है।
Frequently asked questionsअक्सर पूछे जाने वाले सवाल
- Do I need the JDK or the java.com download?
- To compile or write Java code, install a JDK (Oracle JDK or Microsoft Build of OpenJDK). To only run a Java program on a personal PC, java.com's download is the official end-user option.
- मुझे JDK चाहिए या java.com वाला डाउनलोड?
- Java कोड लिखने या compile करने के लिए JDK (Oracle JDK या Microsoft Build of OpenJDK) इंस्टॉल करें। निजी PC पर सिर्फ़ कोई Java प्रोग्राम चलाना हो, तो java.com का डाउनलोड आधिकारिक विकल्प है।
- I just installed Java and still get 'not recognized'. Why?
- A Command Prompt window opened before the install doesn't see the change. Close it, open a new one and run java -version. If it still fails, add the JDK's bin folder to PATH.
- मैंने अभी Java इंस्टॉल किया, फिर भी 'not recognized' आ रहा है। क्यों?
- इंस्टॉल से पहले खुली Command Prompt विंडो को बदलाव नहीं दिखता। उसे बंद करें, नई खोलें और java -version चलाएँ। फिर भी फ़ेल हो, तो JDK का bin फ़ोल्डर PATH में जोड़ें।
- Which folder do I add to PATH for Oracle JDK 25?
- The JDK's bin folder. Oracle's default install location for JDK 25 is C:\Program Files\Java\jdk-25, so the entry is C:\Program Files\Java\jdk-25\bin; check the exact folder name in File Explorer.
- Oracle JDK 25 के लिए PATH में कौन-सा फ़ोल्डर जोड़ूँ?
- JDK का bin फ़ोल्डर। JDK 25 की Oracle की default जगह C:\Program Files\Java\jdk-25 है, इसलिए एंट्री C:\Program Files\Java\jdk-25\bin होगी; फ़ोल्डर का सही नाम File Explorer में देख लें।