Helpful ways of having one project use the classes/jars of another [message #1495982] |
Tue, 02 December 2014 17:31 |
tgm 1024 Messages: 8 Registered: November 2014 |
Junior Member |
|
|
Using eclipse/luna.
Ok, for some reason, this seems much harder for me to figure out in Eclipse than in any of the other java IDE's I've played with over the years since VisualCafe in the 90's. I must be misreading something in the settings.
For this example, let's say I have one project dedicated to making common code usable by multiple projects. Let's call that project "Common", and it consists of two packages:
aaa.bbb.common.one and aaa.bbb.common.two
each with some number of classes each.
I have another project called "Project1", and another called "Project2", both of which use the classes created in project "Common".
1. How do I get the project "Common" to create a jar file such that I can use it in other projects?
2. How do I get Project1 to simply reference the location of the Common project so that all classes created by Common are immediately accessible?
3. Having accomplished #1 above, can I have a single project create two distinct jars (for each of the two packages)?
In a non-IDE evironment (editor + commandline) I would be modifying the classpath and either hand-creating the jars, or using a makefile. But in eclipse, what are the cleanest and simplest ways of doing #1 and #2 above?
Thanks!
No, synchronized method declarations will not get you out of this newbie multithreading pitfall:
thing.set(thing.get() + 1);
[Updated on: Tue, 02 December 2014 17:33] Report message to a moderator
|
|
|
|
Re: Helpful ways of having one project use the classes/jars of another [message #1496072 is a reply to message #1496033] |
Tue, 02 December 2014 19:10 |
tgm 1024 Messages: 8 Registered: November 2014 |
Junior Member |
|
|
Stephan Herrmann wrote on Tue, 02 December 2014 13:292. In project1's properties, find the Build Path page, select tab "Projects" and add project Common.
- this does not require step 1.
Ok, thanks. Regarding #2 above though, I think I discovered the problem I've encountered.
The "required" project (Common) must be open in order for me to add it. Or I get the following tab (with no way to add):
And even after I add it, if I close the dependency project Common, then it can't be used in its build. This is counter-intuitive to me.
No, synchronized method declarations will not get you out of this newbie multithreading pitfall:
thing.set(thing.get() + 1);
[Updated on: Tue, 02 December 2014 19:11] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02551 seconds