Steps for Setting Classpath path for jar file have been given below. During the compilation of java file, classes in the jar file will be referred even the jar file is located in any directory in the system if the classpath had been set in environment variable.
Steps for setting classpath for jar files java using environment variable
- My Computer -> Right click -> Properties
- Environmental Variables -> New
- Sample.jar file is located in directory D:\jar