File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes class path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class path" Watch "class path" New topic

class path

Tamana Joshi

Joined: May 23, 2005
Posts: 21
hi all,
plz tell me how to set class path.
why we people do it?
Joel McNary

Joined: Aug 20, 2001
Posts: 1824


How To Set The Classpath in the FAQ.

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
The CLASSPATH is an environment variable that a) tells the java compiler where to look for class files to import and b) it tells the JVM where to find class files to interupt.
How to set you classpath depends on the operating system you are currently working on. For more info read Your First Cup Of Java for the particular operating system on your computer
[ June 15, 2005: Message edited by: Nigel Browne ]
Henry Kaldera

Joined: May 29, 2005
Posts: 9
in a windows machine

Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
sorry DIXX but dont you think it should be
set classpath=%CLASSPATH%;C:\..........
if i am wrong plz correct me.

Life called,so here I am.<br />Cheers<br />Niki.:-)
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
can someone explain to me in plain language how to set classpath for windows XP. I've looked at "how to set classpath in FAQ section, and it wasn't much help!

right now what i do is type in the entire path at the command promt before compiling.

Who dares, wins! (SAS motto)
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
Did you see the section on

Instructions on Setting the CLASSPATH on different Operating Systems

For Windows XP/2000/NT

in the FAQ??

What part did you not understand?

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
okay, this is what it says to type in the user variables window

suppose the path to my classes is c:\program files\java\jdk1.5.0_03\bin

what would i then type in?
and how is this better than how i already access these files? in other words whats the reason for classpath?

(sorry if question sounds daft!)
I agree. Here's the link:
subject: class path
It's not a secret anymore!