Benjamin Eltzner
2014-09-10 15:24:05 UTC
Dear mailing list,
I am a novice Java programmer (~ 10 months) currently maintaining a Java
program which includes quite some image processing. I would like to use
imageJ as a backend for the image processing (and in the course of this,
transform my filters into imageJ plugins). However, when using an
external jar, I run into a portability problem:
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. 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? (I do not want to include imageJ code in my jar, to avoid
duplication, and also because I explicitly want to make use of imageJ's
own structure, e.g. its plugin handling. Also, I am sure there must be
tons of relevant documentation on the internet, but despite the fact
that I tried hard to find a solution by myself, I have now been stuck on
this issue for weeks.)
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.)
The next best solution would be to have a platform independent
installer, that asks the user where his ij.jar is and then creates a
shell script / batch file that runs my jar with the appropriate path to
the ij.jar. Is there a convenient way to accomplish that for all
platforms when programming only on Linux?
Is there some other, clever way to accomplish what I want? I would be
very glad about any helpful comments.
Best regards,
Benjamin
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
I am a novice Java programmer (~ 10 months) currently maintaining a Java
program which includes quite some image processing. I would like to use
imageJ as a backend for the image processing (and in the course of this,
transform my filters into imageJ plugins). However, when using an
external jar, I run into a portability problem:
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. 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? (I do not want to include imageJ code in my jar, to avoid
duplication, and also because I explicitly want to make use of imageJ's
own structure, e.g. its plugin handling. Also, I am sure there must be
tons of relevant documentation on the internet, but despite the fact
that I tried hard to find a solution by myself, I have now been stuck on
this issue for weeks.)
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.)
The next best solution would be to have a platform independent
installer, that asks the user where his ij.jar is and then creates a
shell script / batch file that runs my jar with the appropriate path to
the ij.jar. Is there a convenient way to accomplish that for all
platforms when programming only on Linux?
Is there some other, clever way to accomplish what I want? I would be
very glad about any helpful comments.
Best regards,
Benjamin
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html