Difference between path and classpath

Google Advertisements

ClassPath Setting in Java Java First Program

Difference between path and classpath in Java

Path in Java

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.

difference between path and classpath in java

classpath in Java

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 in Java

pathclasspath
path variable is set for providing path for all java tools like java, javac, javap, javah, jar, appletviewerclasspath variable is set for provide path of all java classes which is used in our application.
It contains a path to the java toolsIt contains a path of the classes provided by JDK
Java tools include java, javac, javap, javah, jreAll the classes are available in “rt.jar” file.
Command to check path: >>echo %path%Command to check classpath: >>echo %classpath%

JDK Folder Hierarchy

jdk folder

Path variable is set for use all the tools like java, javac, javap, javah, jar, appletviewer etc.

Example

"C:\Program Files\Java\jdk1.6.0\bin"
difference between path and classpath

All the tools are present in bin folder so we set path upto bin folder.

Classpath variable is used to set the path for all classes which is used in our program so we set classpath upto rj.jar. in rt.jar file all the .class files are present. When we decompressed rt.jar file we get all .class files.

Example

"C:\Program Files\Java\jre1.6.0\jre\lib\rt.jar"

In above rt.jar is a jar file where all the .class files are present so we set the classpath upto rt.jar.

difference between path and classpath in java
ClassPath Setting in Java Java First Program

Google Advertisements

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Cloud Computing Tutorial

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects. Download Java C C++ Projects

Download Projects

Adsense Advertisements


Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: hitesh.xc@gmail.com or 8076671483 Try this Keyword C++ Programs