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 Package question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Package question." Watch "Package question." New topic
Author

Package question.

Pete Tyo
Ranch Hand

Joined: May 11, 2005
Posts: 38
I downloaded a package that I want to mess around with. I do not understand where I need to put it though...
I am working in a directory c:\jdk\app that is where my main program I am creating is at. the package say net.something.stuff okay I now where that folder system is at.. Do i need to put the folders in the
c:\jdk\app director to use import net.something.stuff.*; ??? We never had to do this in are class and for some reason I can't figure this out.

Thanks,

Pete
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
add your package to classpath


java amateur
Sania Marsh
Ranch Hand

Joined: Jul 12, 2004
Posts: 469
It doesn't really matter where you put it, but you better have one place where you keep your packages.
What important is that the root directory path where you place you package is listed in the CLASSPATH environment variable.
You can also place the package in the folder your .java file is, that should work without setting the CLASSPATH, if it doesn't, you can add "." as path in the CLASSPATH.

To set the CLASSPATH on Windows go to Control Panel->System-> Advanced Tab ->Environment Variables, don't overwrite the CLASSPATH, just add your path at the end afer semicolon.

You should have done this in class, suggest to your professor
Pete Tyo
Ranch Hand

Joined: May 11, 2005
Posts: 38
Ah, okay. I understand now and got it to work thanks..

Pete
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Package question.
 
It's not a secret anymore!