There are the two ways to set PATH in the environment variable, either set the PATH temporary or set the PATH permanently. The disadvantage to set the PATH temporary is that as many as times we compile the Java application, we need to specify the PATH. It takes lots of time and there are more chances to type the wrong command. So, it is not good to use. We recommend you to set the PATH permanently.