top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is difference between Path and Classpath?

0 votes
301 views
What is difference between Path and Classpath?
posted Jan 4, 2017 by Dhaval Vaghela

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Path

Path variable is set for providing path for all Java tools like java, javac, javap, javah, jar, appletviewer. In Java to run any program we use java tool and for compile Java code use javac tool. All these tools are available in bin folder so we set path upto bin folder.

classpath

classpath variable is set for providing path of all Java classes which is used in our application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar.

Difference between path and classPath

path classpath
path variable is set for providing path for all java tools like java, javac, javap, javah, jar, appletviewer classpath variable is set for provide path of all java classes which is used in our application.

answer Jan 4, 2017 by Karthick.c
...