• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

what is the different between PATH and CLASSPATH ?

 
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the different between PATH and CLASSPATH ?
 
author
Posts: 23928
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The PATH environment variable is an OS variable -- not a Java variable. It is used by the OS to find executables when you run them, without specifying the fully qualified path. In relation to Java, you set this variable so that you can get to the Java executables, such as java, javac, jar, etc.

The CLASSPATH environment variable is a variable used by Java. The Java compiler uses it to resolve classes -- so that it can compile classes that uses other classes. And the JVM uses it to load (and then run) code from those classes.

Henry
 
Marshal
Posts: 76854
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You ought to set your PATH, and you ought not to set a CLASSPATH, as system variables.
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a example when i am going to configure tomcat i should set the classpath varible to
Apache Software Foundation\Apache Tomcat 6.0.16\lib
then it means when compiling if he find first jar files in classpath varibles.Is it?
 
Campbell Ritchie
Marshal
Posts: 76854
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I think so. But not only when compiling; you need the same classpath when executing the application.
 
reply
    Bookmark Topic Watch Topic
  • New Topic