Linking java files [message #1799883] |
Sun, 16 December 2018 14:03  |
Eclipse User |
|
|
|
Hello,
I will describe you my situation :
I have 3 different projects in my workspace, and in these 3 projects I have 3 times the same class, with same methods, etc. Problem is, when I want to edit something in one project, I would like that it's edited too in the 2 other projects.
I tried to create another Java Project with only this class inside, and then link the file in the projects via New > File > Advanced > choose the file path. Problem : package are not same in all projects, so the package declaration throw an error.
If I try to link the source folder, I will not be able to choose where I want theses classes to be (in what package). Same problem with "required project" option.
So, my final question is : is it possible to link the same class in different projects and to choose in what package there will be ?
Thank you
|
|
|
Re: Linking java files [message #1799920 is a reply to message #1799883] |
Mon, 17 December 2018 08:40  |
Eclipse User |
|
|
|
Hi
You might as well ask if you can have three bank accounts so that whenever you make a deposit to one your balance improves in all three.
If you want re-use, re-use, probably by inheritance, perhaps by a shared library. Else if what you want is really what you want create a build script that copies a master to two slaves.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.24765 seconds