Allowing Java Applet to Access Sandboxed File on MacOS

Although the Java applet's days are numbered, I still need one of them to work on macOS at least until a new alternative is available - Medtronic's CareLink Personal file upload applet. Fortunately, Safari on MacOS is one of the operating system / browser combinations that both the applet's self-imposed, highly restrictive settings allow itself to run on, and that the browser itself allows to run Java applets. Note that specifically for this applet, as of this writing, those who have upgraded to macOS High Sierra (10.13.2) will need to modify the user agent using Safari's "Develop" menu to an older version. My current change to this - the OS  X version - is as follows:
 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/604.4.7 (KHTML, like Gecko) Version/11.0.2 Safari/604.4.7 
 After a recent update, either to macOS or the Java Runtime Environment, the applet kept reporting errors when attempting to perform the upload of history from my insulin pump to the website. I went ahead and turned on the Java console (System preferences > Java to open the Java Control Panel, then go to the Advanced tab and select "Show console" under the "Java console" section). Attempting the upload led to the following error being logged:
Loading Mac Bayer USB JNI Library: /Users/[username]/Library/Medtronic/ddmsDTWusb/Bayer/bci_jni_wrapper.dll ...FAILED java.lang.UnsatisfiedLinkError: /Users/[username]/Library/Medtronic/ddmsDTWusb/Bayer/bci_jni_wrapper.dll: dlopen(/Users/[username]/Library/Medtronic/ddmsDTWusb/Bayer/bci_jni_wrapper.dll, 1): no suitable image found. Did find: file system sandbox blocked open() of '/Users/[username]/Library/Medtronic/ddmsDTWusb/Bayer/bci_jni_wrapper.dll' 
.... 
Realizing that the problem was that I needed to allow a Java applet to access files on macOS, I searched for information on that, and came across this solution by "fycth" on stackoverflow.com:
For Safari 11:
  1. go to Safari Preferences->Websites->Plug-ins, and select Java
  2. at the right side you can see list of 'Allow websites to use this plug-in with settings below'
  3. now select the website
  4. press and hold Option button and then click the three option (Ask, Off, On), you will see additional option 'Run in safe mode' - un-check this option.
I hope that the handful of people out there who still need to run similar applets on macOS may find this tip as helpful as I did.

Comments

Popular posts from this blog

Using KeePass with Dropbox for Cross-Platform Password Management

Visiting CareLink Site on OS X Mavericks

Website FINALLY Adapted to Apple Silicon