Results 1 to 2 of 2

Thread: packages

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

    Default packages

    Hello,

    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:
    index.java:37: package UserAccounts does not exist
    import UserAccounts.*;
    How can I reach this package that is in a folder beside data_persistence?

    Thanks,
    ~fogus

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

    Default

    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-10-2008, 12:11 AM
  2. Replies: 3
    Last Post: 02-12-2008, 12:03 PM
  3. Using packages
    By prfalco in forum New To Java
    Replies: 5
    Last Post: 01-31-2008, 11:38 PM
  4. packages
    By ai_2007 in forum Advanced Java
    Replies: 1
    Last Post: 07-31-2007, 01: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
  •