QuickReload doesn't work on M1 MacBooks

Hi,

the QuickReload plugin doesn’t work when running Confluence (probably same issue with Jira) with a native arm64 JDK on M1 MacBooks:

java.lang.UnsatisfiedLinkError: Can't load library: /Users/jens/k15t/confluence-7.18/atlassian-confluence/temp/jpathwatch-nativelib-v-0-95-atlassian-1-libjpathwatch-native-32.dylib
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2633)
	at java.base/java.lang.Runtime.load0(Runtime.java:768)
	at java.base/java.lang.System.load(System.java:1837)
	at name.pachler.nio.file.impl.NativeLibLoader.extractAndLoadLibrary(NativeLibLoader.java:406)
	at name.pachler.nio.file.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:256)
	at name.pachler.nio.file.impl.Unix.<clinit>(Unix.java:86)
	at name.pachler.nio.file.impl.BSDPathWatchService.open(BSDPathWatchService.java:241)
	at name.pachler.nio.file.impl.BSDPathWatchService.<init>(BSDPathWatchService.java:80)
	at name.pachler.nio.file.ext.Bootstrapper.newWatchService(Bootstrapper.java:86)
	at name.pachler.nio.file.FileSystems$1.newWatchService(FileSystems.java:40)
	at com.atlassian.watch.nio.file.api.FileSystems$FileSystem.jWatchService(FileSystems.java:42)
	at com.atlassian.watch.nio.file.api.FileSystems$FileSystem.newWatchService(FileSystems.java:31)
	at com.atlassian.labs.plugins.quickreload.DirectoryWatcher.<init>(DirectoryWatcher.java:62)
	...

It tries to load the native lib from these locations as well, but also fails (same stacktrace otherwise):

java.lang.UnsatisfiedLinkError: Can't load library: /Users/jens/k15t/confluence-7.18/atlassian-confluence/temp/jpathwatch-nativelib-v-0-95-atlassian-1-10280375601353966685libjpathwatch-native-32.dylib
java.lang.UnsatisfiedLinkError: no jpathwatch-native in java.library.path: [/Users/jens/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .]

Java Runtime Environment:

Operating System:           Mac OS X 12.5.1
OS Architecture:            aarch64
Application Server:         Apache Tomcat/9.0.63
Servlet Version:            4.0
Java Version:               11.0.16
Java Vendor:                Eclipse Adoptium
JVM Version:                11
JVM Vendor:                 Oracle Corporation
JVM Implementation Version: 11.0.16+8
Java Runtime:               OpenJDK Runtime Environment
Java VM:                    OpenJDK 64-Bit Server VM

QuickReload version is 3.2.0

I assume this happens because there simply is no native library for arm64/aarch64 in the QuickReload plugin’s JAR.

Can you please fix this so we can continue to enjoy QuickReload?

Thanks,
Jens

5 Likes

Hi Jens,

I am able to replicate this issue in both JDK 1.8 and JDK 11 ( jdk-11.0.16) and able to resolve it with the below changes.

Please try with 11.0.3 or 11.0.9 version and add the below recommended configurations in the plugin’s POM where the product-specific plugin is configured.

<enableDevToolbox>false </enableDevToolbox>
<enablePde>false</enablePde>
<skipRestDocGeneration>true</skipRestDocGeneration>
<allowGoogleTracking>false</allowGoogleTracking>
<skipManifestValidation>true</skipManifestValidation>
<extractDependencies>false</extractDependencies>

Thanks,
Sang

Hi @SangeethaShanmugaSun, thanks for looking into this!

I’m using this on a standalone Confluence installation (installed according to the official installation guide), not an instance that’s started via maven. So I’m sure that those properties don’t affect it, because none of the dev tools using them are installed in that instance. I’m installing quickreload manually via UPM.

At least extractDependencies is set to false in our product poms, though.

Also I don’t think going back to an older JVM version is a viable long term fix.

Could it be that your 11.0.3 or 11.0.9 JVM versions are x86_64 executables and not aarch64? Because I’m relatively sure that an aarch64 JVM cannot load the x86_64 shared libraries bundled in quickreload, failing with the error I mentioned above.

Cheers,
Jens

I just double checked the release archives of AdoptOpenJDK and Adoptium / Temurin.

AdoptOpenJDK doesn’t have any MacOS/aarch64 builds at all and the oldest release in the Adoptium archive for aarch64 is 11.0.15+10.

Are you using a JVM from another distributor?

Yeah, I am using the OracleJDK and below is the Runtime environment details

java version “11.0.3” 2019-04-16 LTS
Java™ SE Runtime Environment 18.9 (build 11.0.3+12-LTS)
Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.3+12-LTS, mixed mode) and platform is OSX Darwin Kernel Version 21.6.0 xnu-8020.141.5~2/RELEASE_ARM64_T6000 arm64.

Hi, when I use an x64 JVM then quickreload works as expected, but the point of this request was compatibility with aarm64 JVMs to avoid the performance impacts of running x64 executables on Rosetta. :slight_smile:

As far as I understood the problem to enable this a new quickreload release would be required with a release of atlassian-jpathwatch containing an aarch64 version of the native library, essentially “libjpathwatch-native-aarm64.dylib” next to those: Bitbucket