If Windows keeps telling you java is not recognized as a command do not panic yet. This is one of those environment variable dramas that has a simple fix and a lot of melodrama. Follow a few tidy steps in the System Settings and your command prompt will stop ghosting the java executable.
Open a command prompt and run the basic sanity checks. These do not require admin powers and they will tell you whether Windows sees any java at all.
java -version
where java
If java -version prints a version you are mostly fine. If you get a message saying java is not recognized or nothing useful appears then java is not on your PATH and you need to continue.
Locate the JDK installation. Typical places are under Program Files or wherever your installer decided to dump things. The executable you want lives in the bin folder inside the JDK root.
Open System Settings then Advanced system settings then Environment Variables. In the System variables section add a new variable named JAVA_HOME and point it to the JDK root folder you found earlier.
Many developer tools prefer JAVA_HOME to a raw PATH entry so this step is useful and not just for bragging rights.
Edit the System PATH variable and add %JAVA_HOME%\bin at the end of the list. If you prefer you can add the absolute path to the bin folder instead. The UI will handle path separators so you do not need to type anything cryptic.
Make sure you added the bin folder and not the root JDK folder by mistake. java.exe lives inside bin and Windows needs that directory on the PATH for the java command to work from any command prompt.
Close any open command windows and open a new one so the updated environment variables take effect. Run java -version again. If the wrong version shows up run where java to see all java executables on PATH.
where java
If where java lists a copy in some other folder you likely have a conflicting installation. Remove the older entry from PATH or uninstall the stray JRE to stop the confusion.
That is it. Set JAVA_HOME, add the bin folder to PATH, reopen your command prompt and enjoy a world where java responds when you ask it to. If it still complains then the JDK is probably missing or you have another installation messing with PATH. Either way you now know where to poke.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.