Set the PATH variable if you want to be able to conveniently run the Java 2 SDK executables (javac.exe java.exe javadoc.exe etc.) from any directory without having to type the full path of the command. If you don't set the PATH variable you need to specify the full path to the executable every time you run it such as: C:> jdk1.3.1_binjavac MyClass.java It's useful to set the PATH permanently so it will persist after rebooting.
Because TurboC generates .exe files which include all the libraries and runtime references. While in Java generates .class files which requires JRE/JDK libraries at runtime which are searched in CLASSPATH. if you do not specify required libraries files then program will display ClassNotFoundException.
Set the PATH variable if you want to be able to conveniently run the JDK executables (javac.exe java.exe javadoc.exe etc.) from any directory without having to type the full path of the command. If you don't set the PATH variable you need to specify the full path to the executable every time you run it such as: