Search code examples
javamacosmacos-high-sierraapp-bundleapfs

OSX Java App Bundle runs on HFS+ but not APFS


I've been encountering this issue that I find has no information on the web and would like some help as I've been working on this for the last few days with no leads.

Why does my java app suddenly stop working for APFS? It works if I move the app to a non-APFS USB, but when I move the App to the SSD which is formatted to APFS, it stops working.

When I checked the app logs, it turns out that for some reason, certain libraries are not being properly imported/recognized by the app when it is run from the SSD formatted to APFS. Why would it behave differently in an APFS SSD vs an HFS+ usb/hard drive?

I've already isolated the case and found that only the APFS is the common factor. I've tested it in other devices, those that run High Sierra without an APFS drive, and those that run Sierra with an SSD that has not yet been converted to an APFS drive, and only those devices which utilize APFS filesystem formatting are encountering the issue.

Additional Information:

  • Java App has been properly signed, it is distributed personally but not via the App Store.
  • App is bundled using AppBundler not JavaPackager.
  • App runs on previous versions of OSX, and has been distributed and tested working on hundreds of Mac Devices with OSX varying between 10.8 - 10.12
  • Libraries that somehow don’t get recognize are the apache libraries, like commons-lang-2.6 (We haven’t upgraded to 3 yet), commons-logging (had to output the logs manually onto desktop to see what was happening). Strangely, app was able to import sqlite library properly.

Thanks for looking, and would appreciate any advice!


Solution

  • I’ve managed to fix the above issue, but I’m unsure as to why.

    Solution: Update commons.lang.2.6 to commons.lang.3.6

    Currently, I’m hoping that it will not encounter any other issue aside from that, but I can only guess as to what was happening.

    I think APFS cached a copy of commons.lang.3.6 and used that library instead of my own, so there was an issue with class loaders trying to find the 2.6 version. Since only APFS would have a cached copy, it would allow my app to run on a USB.


    I don’t actually know the correct etiquette for finding out the answer to your own question, so please feel free to correct my post if there’s anything I need to change.