Eclipse Library Management
Hello,
I am a relatively new java developer trying to learn eclipse ide. I am working on a application that I have divided into 4 eclipse projects.
Project 1 - Base Application
----src
------main for all projects
----all required jars
Project 2 - Extends Project 1
----src
Project 3- Extends Project 1
----src
Project 4 - Extends Project 1
----src
My main problem has to do with how to best organize my application, specifically:
-In eclipse how do I prevent circular references. I have it set so 1 depends on 2,3,4 and so 2 depends on 1, 3 depends on 1, and 4 depends on 1. I have turned off errors for circular reference but i think I am not understanding something correctly.
-If Project 2 is extending a member variable in project 1 it doesn't seem to know the type. For example, project 1 has a logger member variable declared protected and of type org.slf4j.Logger. Project 1 can reference this type because I have imported the correct slf4j jar. However, if project 2 tries to use this member variable through inheritance it gets a unknown type error. Do I really have to import the jar to both projects? Or is there a way to get project 2 to see the slf4j jar library in the base project (project 1).
Thanks for your help.
Re: Eclipse Library Management
Quote:
Originally Posted by
bryceray1121
I am a relatively new java developer trying to learn eclipse ide.
Moved from New to Java.
db
Re: Eclipse Library Management
Each project is a distinct thing.
A project produces (in this case) a single jar file, which does not include any dependencies.
Any project that uses that jar file will need to include those dependencies itself, otherwise any bits of the jar that it uses that uses one of those dependencies will not run.
As for your general structure, I'm not entirely sure I understand it. You seem to be implying that project 1 requires the others to work? And those themselves require project 1.
To me that says that these shouldn't have been split in the first place.