How to add JAR file to Classpath in Java
Adding JAR into classpath is a common task for Java programmer and different programmer do it on different way. Since Java allows multiple ways to include JAR file in classpath, it becomes important to know pros and cons of each approach and How exactly they work. There are 5 ways to add jars on into classpath in Java some of them we have already seen in How classpath works in Java and How to set Path in Java. In this post we will revisit some of those techniques and explore Java 1.6 wildcard to add multiple JAR into classpath. By the way here is 5 ways to add JAR file into classpath. In short knowledge of Path, Classpath and Classloaders are must for any Java programmer, not only from knowledge point of view but also to successfully debug and resolve issues related to Classpath e.g. NoClassDefFoundErrorand java.lang.ClassNotFoundException in Java.