In the system, variables click the New button. Select the Advanced tab and then click environment variables.ģ. Now click on the View advanced system settings.Ģ. Go to the Search box and type advanced system settings in it. After setting the path it can load all necessary items in the program including the compiler or interpreter itself.īelow is the procedure for setting the path for both Windows and Linux: Setting Java Path in Windowsġ. This is the reason we set the path and specify the path of the bin folder because the bin contains all binary executable files. Hence, we need to specify the path where the executables are located. The commands java, javac are not known to the operating system as we don’t specify where the executables reside. To execute java console-based programs in windows or Linux environments we have to use java and javac commands. Moreover, the path is just a variable that stores a bunch of shortcuts. The PATH variable prevents us from having to write out the entire path to a program on the Command Line Interface every time we run it. The path once it is set, cannot be overridden. PATH is an environment variable that is used by Operating System to locate the exe files (.exe) or java binaries ( java or javac command).