Open In App

How to Set Multiple Classpath in Java in Windows?

In JAVA, you have to set PATH and CLASSPATH variables correctly before running any java program. After installing JDK, the next step is to set the path and CLASSPATH variables in the Windows system environment variable. CLASSPATH is an environment variable which is used by Application ClassLoader to Locate and Load the class files.

To Set the CLASSPATH there are the following ways :



A. CLASSPATH can be set permanently in the environment.



      

B. CLASSPATH can be set Using command prompt:

 set path=%path%;<java installed directory\bin>

eg: set path=%path%;C:\Program Files (x86)\Java\jdk1.7.0\bin

set classpath=%classpath%;<java installed directory\lib\*.jar>

eg: set classpath=%classpath%;C:\Program Files (x86)\Java\jdk1.7.0\lib\*.jar

Article Tags :