Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Package Questions  RSS feed

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am having an issue with package organization.

I have the following directory sturcture

App ---
srcdir --- is here)
connections ---

I am trying to use cnnectionFactory in customer and customer in testing

I have the following import statements

in customer

import connections.ConnectionFactory

in testing

import core.customers

why I try to compile everything I get the following errors

src/core/ package connections does not exist
import connections.ConnectionFactory;
1 error
src/ package core does not exist
import core.*;

I must have this set up wrong but I am not sure how. Can anyone shed some light on this for me?

Posts: 59108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few things you might try:-
  • You mention folders called connections and core. Check that those are exactly the packages you have declared in your source.
  • Have you compiled anything at all? If you are compiling by hand, use "javac -d ."
  • If you haven't got much compiled, delete everything from your folder except the source files and any other resources you need. That includes folders. Then start from scratch, in the same directory your source files are in.
  • Start with the files farthest from the main method, otherwise your complier will find unfulfilled dependencies of you start with the class with the main method.
  • Use an explorer program to check that the folder structure is the same as you think it is.

  • Anybody else got any suggestions??
    If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
    Rocket Oven Kickstarter - from the trailboss
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!