This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes [solved]Adding classes to PATH in windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "[solved]Adding classes to PATH in windows" Watch "[solved]Adding classes to PATH in windows" New topic

[solved]Adding classes to PATH in windows

Cody Long
Ranch Hand

Joined: Jan 01, 2009
Posts: 95
I am using BlueJ to write my Java code for school, and the provided me with a bunch of classes I need to use. To link the packages to BlueJ is easy, but i wanted to know how to add them to my PATH. I tried to just go to the PATH variable in Environment Variables but when i tried to compile a class that used one of the classes that i need to add to the PATH it gave me an error that it could not find the specified classes. I am using XP Pro SP3

Duct tape is like the Force. It has a dark side, a light side, and it binds the whole universe together.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

You don't put classes on the PATH, but on the CLASSPATH. Either set the the root package of your classes to the CLASSPATH environment variable, or use the "-classpath" flag on the javac command line.

[My Blog]
All roads lead to JavaRanch
Cody Long
Ranch Hand

Joined: Jan 01, 2009
Posts: 95
Oh. That makes sense. Thank you.
Vishal Kashyap
Ranch Hand

Joined: Aug 07, 2010
Posts: 73

Dear Cody,
please try to put all classes in the same package and the try to add path to this package to your CLASSPATH environment variable in your XP. then after restarting your BlueJ try once again to compile it. I am sure that it will compile.

MCSA 2003 | Preparing For OCPJP/SCJP6
Cody Long
Ranch Hand

Joined: Jan 01, 2009
Posts: 95
I added the classes to my CLASSPATH and it worked. Thanks all for your help!
Have you checked out Aspose?
subject: [solved]Adding classes to PATH in windows
It's not a secret anymore!