Posted by
dscho on
Sep 10, 2014; 4:21pm
URL: http://imagej.273.s1.nabble.com/Java-Linking-and-Portability-tp5009568p5009570.html
Hi Benjamin,
On Wed, 10 Sep 2014, Benjamin Eltzner wrote:
> So far my program only uses the Java class library, so I can develop on
> Linux and distribute a runnable jar that will run on Windows, Linux and
> Mac.
You have been avoiding what has been called "dependency hell". That is
sustainable if you develop alone, but if you want to develop together,
you need proper dependency management.
By proper dependency management, I refer to a way to declare which
dependencies (and which versions thereof) your primary project depends on.
As we had the problem you described in Fiji, ever since its beginning, I
daresay we have quite a bit of experience with it, and the best solution
we could come up with is called Maven (
http://imagej.net/Maven)
Of course, this will make things a little less easy for you. But it will
make it possible for you to cooperate with other projects.
> Ideally, the user would just give the path to her ij.jar in a dialog
> within my program, but this seems impossible, since the classpath must
> be set before the program starts. I tried using ClassLoaders but it
> seems that this will result in an extreme amount of "management code".
> (If there is simple solution with ClassLoaders, I would be glad about
> some pointers.)
While this is technically feasible (I could even show you how), it seems
backwards. If you want to implement your processing as ImageJ plugins, you
should let ImageJ manage your plugins, not the other way round.
> What is the sweet spot between "easy for me" and "easy for the users" to
> distribute my program, if it should use a local imageJ install?
There is an ImageJ updater available in ImageJ2 (and consequently in Fiji,
which is just a distribution of ImageJ with plugins): Help>Update...
You can easily set up your own update site that users can simply follow:
http://imagej.net/How_to_follow_a_3rd_party_update_siteCiao,
Johannes
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html