[ImageJ-devel] DefaultLegacyService.preinit Error

Curtis Rueden ctrueden at wisc.edu
Wed Apr 30 11:43:51 CDT 2014


Hi Jay,

> I downloaded and installed Java 1.8 and then I received the following
error
> upon reaching this preinitialization code.
>
> java.lang.IllegalArgumentException: Cannot handle app name in ij.ImageJ's
> public <init>(java.applet.Applet applet, int mode)

Just from your description, I have no idea what could cause such behavior.
If you are able to reproduce reliably on multiple machines, please feel
free to open an issue at
https://github.com/imagej/imagej-legacy/issues/newand we will
investigate. It will be later some time this summer though,
after the June 1 release; for now, we definitely recommend sticking to Java
6 or Java 7.

Regards,
Curtis


On Fri, Apr 25, 2014 at 2:23 PM, Jay Warrick <warrick at wisc.edu> wrote:

> Hi All,
>
> I'm creating a single instance of ImageJ (ImageJ2) in my program and using
> this instance to access the various services of ImageJ2. However, in
> previous work with Curtis Rueden, we found we had to add the following
> static code to the class which I use to access this single ImageJ instance
> so that the services load (I believe because of the presence of the ImageJ1
> jar included along with the ImageJ2 group of jars).
>
> static
> {
>         DefaultLegacyService.preinit();
> }
>
> However I ran into the following issue.
>
> With Java 1.6 and 1.7 installed on my system everything worked great. No
> issues. I downloaded and installed Java 1.8 and then I received the
> following error upon reaching this preinitialization code.
>
> java.lang.IllegalArgumentException: Cannot handle app name in
> ij.ImageJ's public <init>(java.applet.Applet applet, int mode)
>
> at imagej.legacy.CodeHacker.replaceAppNameInCall(CodeHacker.java:498)
>
> at
> imagej.legacy.LegacyExtensions.insertAppNameHooks(LegacyExtensions.java:591)
>
> at imagej.legacy.LegacyExtensions.injectHooks(LegacyExtensions.java:516)
>
> at imagej.legacy.LegacyInjector.injectHooks(LegacyInjector.java:154)
>
> at imagej.legacy.LegacyInjector.injectHooks(LegacyInjector.java:57)
>
> at
> imagej.legacy.DefaultLegacyService.<clinit>(DefaultLegacyService.java:109)
>
> I then used the old but useful "Java Preferences.app" to change the
> default order of preferred jres. I moved 1.7 ahead of 1.8 and the
> application worked again. Then I put 1.8 above 1.8 again and the problem no
> longer occurred. I can't repeat the problem on my computer but another
> person is having the same issue. I'll likely have him do what I did but
> this seems like a silly work around. Do you know what might be the root
> cause? Am I just using the ImageJ2 project with inappropriate/unsupported
> jre's even though it eventually works under 1.8.
>
> Thanks,
>
> Jay
>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/listinfo/imagej-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20140430/0b851968/attachment.html>


More information about the ImageJ-devel mailing list