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 does not exist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Package does not exist" Watch "Package does not exist" New topic

Package does not exist

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Hi. This is probably something really little and stupid that I'm missing, but I can't figure it out! I have created a folder in windows explorer that is named com/storekraft/lib. There are other folders besides lib in this path that I am using and importing into my java apps that are working. However, when I try to import com.storekraft.lib.*; it keeps telling me the package does not exist! I have this in my classpath, is there something else I am forgetting? The only thing in the "lib" folder is a JDBC driver file. That shouldn't matter should it?
Thanks for any help!
Greg Charles

Joined: Oct 01, 2001
Posts: 2968

What do you have in your classpath? Is it com/storekraft/lib (wrong) or the directory that com/storekraft/lib is in (right)? Is the driver file you have there a compiled class file (right), or a Java source file (wrong)? Have you made any spelling errors anywhere? (Oh, that would be wrong too. )
You're right though, even if a package just contains a single class, you can import it with:
import com.storekraft.lib.*;
Hari Gangadharan
Ranch Hand

Joined: Mar 08, 2001
Posts: 73
And also what is the actual package name of the JDBC driver.. if it is then you may have to place it in an appropriate directory.

<B>Hari Gangadharan</B><BR>Unix is user friendly..<BR>but it chooses to whom it is friendly with!
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
In my classpath, I have "I:/VSK Java Programs/com/storekraft/lib;". In the "lib" folder, I have a jar file (jt400.jar). I guess I'm confused because before in my classpath all I had was "I:/VSK Java Programs;" and that is working for the folders that were in there before. What is different now?
Thanks again for your help!
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Import statements are for importing classes, not packages. To import somepackage.* is to import every class found in that package. You cannot import a package that doesn't have any class files in it (so to speak). You said you have a jar file in a folder. You cannot import the location of a jar file. You would want to specify the location of the jar file in the classpath setting.
Making sense?

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Gotcha Dirk! I told ya it was probably something stupid! I'll make sure and write that one down so I remember next time!!! THANK YOU!!!
Stephen Johnson

Joined: Feb 05, 2003
Posts: 1
any hints or useful websites on how to create a jtree node from info entered in a dilaog box containing a textfield for the user to enter text into. Say, that node would be called wahtevers entered in textfield after user clicks ok

and thats the bottom line
I agree. Here's the link:
subject: Package does not exist
jQuery in Action, 3rd edition