Results 1 to 2 of 2

Thread: packages

  1. #1
    fogus is offline Member
    Join Date
    Mar 2008
    Rep Power

    Default packages


    I have a file at:

    \Data Persistence\data_persistence

    that needs to access a package at:

    \Data Persistence\UserAccounts

    When starting my file with:
    Java Code:
    import UserAccounts.*;
    I get:
    Java Code: package UserAccounts does not exist
    import UserAccounts.*;
    How can I reach this package that is in a folder beside data_persistence?


  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Rep Power


    Set your CLASSPATH to include the \Data Persistence directory, and make sure the classes in the UserAccounts directory have at the top:

    Java Code:
    package UserAccounts;
    FYI, convention has packages as all lower case except when acronyms are in play, although this is not required by the language.

Similar Threads

  1. switching packages
    By DuceDuceExplorer in forum NetBeans
    Replies: 4
    Last Post: 07-09-2008, 11:11 PM
  2. Replies: 3
    Last Post: 02-12-2008, 11:03 AM
  3. Using packages
    By prfalco in forum New To Java
    Replies: 5
    Last Post: 01-31-2008, 10:38 PM
  4. packages
    By ai_2007 in forum Advanced Java
    Replies: 1
    Last Post: 07-31-2007, 12:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts