If you want command line Java tools to stop sulking and actually run, set a system variable named JAVA_HOME that points to your JDK root and add its bin folder to your PATH. This works on Windows 7 and keeps java version chaos to a minimum.
Open Explorer and look under Program Files\Java for a folder named jdk followed by a version number such as jdk1.8.0_xxx. Prefer a JDK folder rather than a JRE folder so compilers and other developer tools behave themselves.
Go to Control Panel then System then Advanced system settings then Environment Variables. In the System variables section click New if JAVA_HOME is not present or Edit if it already exists. Set the value to the full path of the JDK root for example Program Files\Java\jdk1.8.0_251 or a similarly named folder on the C drive.
System variables apply to all users and to services that may invoke Java. If you only set a user variable some tools might still pick up the wrong Java and then blame you for their existential crisis.
Edit the system PATH and add %JAVA_HOME%\bin as a new entry or append it to the existing string using the standard Windows path separator. Putting %JAVA_HOME%\bin near the front ensures the JDK you just pointed to is the one command line tools find first.
Close any open command prompt windows and open a fresh one. Then run these commands to confirm everything is sane.
java -version
echo %JAVA_HOME%
There you go. You found the JDK folder adjusted environment variables and verified the change from the command prompt. If the command line still complains go hunting for stray Java installs and remember to open a new session after making changes.
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.