Results 1 to 5 of 5
  1. #1
    Tartaglia is offline Member
    Join Date
    May 2012
    Posts
    14
    Rep Power
    0

    Default Importing Packages

    Hello everyone,

    I have a very basic question, I am having difficulties importing a package, i.e. the
    following command will not compile.

    import uchicago.src.sim.topology.space.AbstractNeighborho od;

    (Note: this package is part of a the libraries from the Repast environment, all the other packages are imported w/o problems). Searching the
    repositories, I could not find it, and I am not sure which jar file corresponds to it and where I can find it (on sourceforge I could not find
    information about the needed jar file, Moore3DNeighborhood (RepastJ API Documentation)).

    Does anyone have an idea where to find the right jar file?

    Thank you for your help,
    Tartaglia

  2. #2
    kammce's Avatar
    kammce is offline Senior Member
    Join Date
    Dec 2010
    Location
    California
    Posts
    194
    Rep Power
    4

    Default Re: Importing Packages

    Are you sure the file actually exists?

    Also, is there a typo in your code as well?
    Java Code:
    uchicago.src.sim.topology.space.AbstractNeighborho od
    should be
    Java Code:
    java.lang.Object.uchicago.src.sim.topology.space.AbstractNeighborhood
    Try that out.

    Edit:
    Actually... I am not too sure. I tried this out as well, and I cannot seem to find this file either. Maybe it is deprecated.
    Last edited by kammce; 07-12-2012 at 08:41 PM.
    My API:
    Java Code:
    cat > a.out || cat > main.class

  3. #3
    Tartaglia is offline Member
    Join Date
    May 2012
    Posts
    14
    Rep Power
    0

    Default Re: Importing Packages

    Thad didn't do the trick, it seems that java.lang.Object has something to do with it though, I imported that one separately actually until now. The thing is, I imported all other packages that way (w/o java.lang at the beginning, i.e. starting with uchicago.src.sim. .... ) and worked fine

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: Importing Packages

    There is no need to import anything explicitly from the java.lang package; the compiler imports the entire package implicitly.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Tartaglia is offline Member
    Join Date
    May 2012
    Posts
    14
    Rep Power
    0

    Default Re: Importing Packages

    So it turns out, the source of my troubles was actually somewhere else. I implemented the method, which was requiring these packages, in a wrong way, and the necessary packages were available all along. Sorry for wasting your time, thank you though for trying to help. I agree with you kammce, it must be a deprecated package.

    Anyway, the new method is still causing me some problems, but I will have to post that in a new thread because it is not related to this topic.

    Thanks so much again for your time, I appreciate it.

Similar Threads

  1. Importing packages and classes
    By tnrh1 in forum New To Java
    Replies: 3
    Last Post: 11-07-2011, 02:35 PM
  2. Importing Packages
    By shadowfax57 in forum New To Java
    Replies: 3
    Last Post: 12-28-2010, 07:48 PM
  3. importing packages
    By mustachMan in forum New To Java
    Replies: 3
    Last Post: 01-20-2010, 05:07 AM
  4. help with importing packages
    By orrymr in forum New To Java
    Replies: 1
    Last Post: 08-07-2009, 08:18 PM
  5. Replies: 3
    Last Post: 02-12-2008, 11:03 AM

Posting Permissions

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