• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Package does not exist

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.*;
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And also what is the actual package name of the JDBC driver.. if it is org.xxx.yyy.jdbc then you may have to place it in an appropriate directory.
 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic