The PATH is where your os will look for program names.
i.e if you open a terminal/command-prompt and type in:
It needs to know where to find the java executable, so you have to add it's parent directory to your path environment variable, see here for example:
JAVA_HOME is another variable that other software makes use of when running java
To see if it is set correctly you can use this command in command-prompt
You can use the %NAME% syntax to echo out any variable available
i..e. to see your current path: