Warning: Once you make a mistake during your installation, it is really hard to figure out where you made the mistake. So, follow the instructions carefully.
Follow these steps:
Capitalization of the name does NOT matter. That is, PATH is considered the same as path or Path.
If a PATH variable does not already exist (most likely it is already there), then add a new variable named PATH, with the value C:\Program Files\Java\jdk-14.0.2\bin. You do it by using the New button. OK to complete.
If PATH already exists, select it and use the Edit button to add the Java path value as the last item (separated by a semicolon, ';') or as the last line. The value that you want to add is most likely C:\Program Files\Java\jdk-14.0.2\bin if you are installing "JDK 14.0.2". This is the location where the Java compiler ('java.exe') was installed in your file system. OK to complete.
Compile and run a simple Java program to verify your installation on the command line. If you are not familiar with some of the DOS commands, try the DOS Lab before you try this.
javac Hello.javaThis will create a new file named Hello.class in the same folder where Hello.Java is located. You can check that using the dir command.
The value associated with the PATH variable tells the operating system (the DOS operating system in this case) to look in those places (all the folders included as the Value of the PATH variable) for the definition of the command that you are issuing (javac in this case).
java HelloThis will produce the output that you expected if your installation was done correctly.
Even if the PATH variable is set correctly, there is a small chance that the 'java' command may not work even if the 'javac' command worked. If that happens, it is most likely that the CLASSPATH variable is already being used by some other program already installed on your computer. The value associated with the CLASSPATH variable tells the operating system (e.g., DOS) to look in those places (all the folders included as the Value part of the CLASSPATH variable) for the .class file that you are trying to run with the 'java' command. That is, PATH tells DOS where to find the definition of the command ('javac' and 'java'), whereas CLASSPATH tells DOS where to find a .class file to run.
If your 'java' command does not work, check to see if CLASSPATH (uppercase or lowercase letters or some mix of uppercase and lowercase letters) is defined in the Environment Variables section as before. If defined, check the value of CLASSPATH. (One student reported to me that the value his had was C:\Program Files\QuickTime\QTSystem\QTJava.zip.) The value of CLASSPATH should start with a line containing a '.' (that is a dot without the single quotes) if it is already defined. Close your DOS window and open a new one and try 'java Hello' again. If this does not fix your problem, you made a mistake somewhere else.