Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

diff between path & classpath

 
balaji karth
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi to all
I want to know the difference between setting path and classpath
I use path for executing java files from a different folder but whats is the use of CLASSPATH then....pls give me a clear idea abt that ...many gave me different answers..
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had made a tutorial about path and classpath. I would recommend to go through it. You can fint it here
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In short, PATH is used by the operating system to find executable files (.exe's in Windows) that it can run. CLASSPATH, on the other hand is specifically used by Java to find .class files that are needed when you run a Java program.

Layne
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Setting the PATH variable allows you "to conveniently run the JDK executables (javac.exe, java.exe, javadoc.exe, etc.) from any directory without having to type the full path of the command." To set the PATH, see these installation instructions for 32-bit Windows. (For other operating systems, click here.)

Setting the CLASSPATH variable "tells JDK tools and applications where to find third-party and user-defined classes." To set the CLASSPATH, see these JavaRanch instructions or Sun instructions.
 
balaji karth
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
now i have got a clear idea abt that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic