Drag Drop with JDK/JRE > 8

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Drag Drop with JDK/JRE > 8

Alan Brooks
There are a couple of issues that I see when using a JDK version 11 or newer on macOS:
1. Drag-and-drop of a file (such as a .tif) to the dock ImageJ icon no longer works
2. Double-click to open a file (such as a .tif where I have set ImageJ to be the default handler for .tif) no longer works

In both cases, the file simply does not open. Images open fine if I drag-and-drop on the ImageJ window itself or open via the file menu.

These issues do not occur if I use the bundled x86_64 JDK (w/Rosetta2 doing it’s emulation as I’m testing this on an M1 Mac). They do occur with multiple ARM JDKs — I tried Azul Zulu JDK/JREs 11, 15, 16 and BellSoft liberica JDK 15 just to see.

On a hunch I tried updating the macOS ImageJ JavaApplicationStub (based on version 0.9.0 of https://github.com/tofi86/universalJavaApplicationStub <https://github.com/tofi86/universalJavaApplicationStub>) stub ImageJ.app/Contents/MacOS/ImageJ with the latest version 3.2.0 of the universalJavaApplicationStub, but the behavior was no different.

Also, if I replace the JRE bundled with ImageJ (Oracle x86_64 1.8.0_172) with the Zulu/Azul <https://www.azul.com/downloads/zulu-community/?os=macos&architecture=arm-64-bit&package=jre> JRE (aarch64 1.8.0_282) I do not see these issues while also letting me run ImageJ with a native JRE. So it does not seem to be an ARM problem.

So I think the problem is something about newer JDK/JREs.

Perhaps would it be worth making:
a. A bundled ImageJ distribution for Mac arm machines? (With Zulu 8 for now?)
b. Some updates to better support running with newer JDK/JREs?

Alan




--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Drag Drop with JDK/JRE > 8

Wayne Rasband-2
> On Mar 25, 2021, at 4:47 PM, Alan Brooks <[hidden email]> wrote:
>
> There are a couple of issues that I see when using a JDK version 11 or newer on macOS:
> 1. Drag-and-drop of a file (such as a .tif) to the dock ImageJ icon no longer works
> 2. Double-click to open a file (such as a .tif where I have set ImageJ to be the default handler for .tif) no longer works

JDK 11 and newer on macOS do not support the MacAdapter library ImageJ uses to implement drag and drop to the dock, the ImageJ>About ImageJ command and the ImageJ>Preferences command. I do not know what to replace MacAdapter with since the recommended replacement (com.apple.eawt) appears not to exist on OpenJDK 13.

There is an ImageJ distribution for Mac arm machines bundled with OpenJDK 1.8.0_282 from Azul Systems at

   http://wsr.imagej.net/distros/osx/

The file name is ij153-osx-arm-java8.zip.

-wayne

> In both cases, the file simply does not open. Images open fine if I drag-and-drop on the ImageJ window itself or open via the file menu.
>
> These issues do not occur if I use the bundled x86_64 JDK (w/Rosetta2 doing it’s emulation as I’m testing this on an M1 Mac). They do occur with multiple ARM JDKs — I tried Azul Zulu JDK/JREs 11, 15, 16 and BellSoft liberica JDK 15 just to see.
>
> On a hunch I tried updating the macOS ImageJ JavaApplicationStub (based on version 0.9.0 of https://github.com/tofi86/universalJavaApplicationStub <https://github.com/tofi86/universalJavaApplicationStub>) stub ImageJ.app/Contents/MacOS/ImageJ with the latest version 3.2.0 of the universalJavaApplicationStub, but the behavior was no different.
>
> Also, if I replace the JRE bundled with ImageJ (Oracle x86_64 1.8.0_172) with the Zulu/Azul <https://www.azul.com/downloads/zulu-community/?os=macos&architecture=arm-64-bit&package=jre> JRE (aarch64 1.8.0_282) I do not see these issues while also letting me run ImageJ with a native JRE. So it does not seem to be an ARM problem.
>
> So I think the problem is something about newer JDK/JREs.
>
> Perhaps would it be worth making:
> a. A bundled ImageJ distribution for Mac arm machines? (With Zulu 8 for now?)
> b. Some updates to better support running with newer JDK/JREs?
>
> Alan

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Drag Drop with JDK/JRE > 8

Alan Brooks
Wayne Rasband-2 wrote
> JDK 11 and newer on macOS do not support the MacAdapter library ImageJ
> uses to implement drag and drop to the dock, the ImageJ>About ImageJ
> command and the ImageJ>Preferences command. I do not know what to replace
> MacAdapter with since the recommended replacement (com.apple.eawt) appears
> not to exist on OpenJDK 13.

Thanks for making the Azul/Zulu arm distribution.

I am no expert, but it appears the functionality in  java.awt.desktop
<https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/desktop/package-summary.html>  
may be the suggested method to accomplish the file opening, prefs, and about
handling in JDKs 9 and newer.

Alan



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html