• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

path and classpath

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anybody help me what is the basic difference between setting path and classpath how can i set path and classpath in windows xp permanently
please help me
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Path tells the OS where to look for executables. So if you want to open a command window to any directory and say "Java -version" you need the path to include the jre\bin directory.

Classpath tells the JVM where to look for classes. When I use classes in the JUnit.jar I have to make sure the classpath includes the JUnit.jar.

You can set either or both in the Control Panel - Start / Settings / Control Panel / System / Advanced Tab / Enviroinment Variables button.

For my own little Java programs I often make bat files to start them up. Then I can modify path & classpath right before running the program. You can override classpath iwth the -cp switch on the Java command.

Try some simple programs to see how this works ... holler again if that's not enough detail. Cheers!
 
Ranch Hand
Posts: 82
  • 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 typically something that the operating system uses to find executable files.

The CLASSPATH environment variable is typically something that implementations of the Java Virtual Machine (JVM) use to find Java class files. Examples are classes12.zip etc.,

To set the variables permanently on XP

Go to your control panel -> Performance and maintainence -> System

When a window opens up go to advanced -> Environment variables
Under System variables you will find PATH.

Add your jdk bin directory to it.

save your settings and you should be ready to go.

Good luck.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic