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 Package question. 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 "Package question." Watch "Package question." New topic

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.


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..

I agree. Here's the link:
subject: Package question.
It's not a secret anymore!