Set Classpath Using Environment Variables For jar Files in Java

Description

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
Classpath Setting Using Environment Variables For jar Files in Java
  • Advanced
Classpath Setting Using Environment Variables For jar Files in Java
  • Environmental Variables -> New
Classpath Setting Using Environment Variables For jar Files in Java
  • Sample.jar file is located in directory D:\jar
Classpath Setting Using Environment Variables For jar Files in Java
  • OK -> OK