core icon indicating copy to clipboard operation
core copied to clipboard

Fix Tomcat native library location for m1 macs

Open spbolton opened this issue 2 years ago • 0 comments

In docker we set th -Djava.library.path=/usr/lib/x86_64-linux-gnu/ this does not work on arm platforms and throws the following error.

dotcms_1 | 30-Aug-2022 21:26:23.194 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/lib/x86_64-linux-gnu/]

We can make this context sensitive by getting the arcitecture from the system and should automatically set this to the right path using /user/libaarch64-lib-gnu. The value is set in JAVA_OPTS_BASE in 00-config-defaults.sh

-Djava.library.path=/usr/lib/$( uname -m )-linux-gnu/

full line becomes

export JAVA_OPTS_BASE=${JAVA_OPTS_BASE:-"-Djava.awt.headless=true -Xverify:none -Dfile.encoding=UTF8 -server -Dpdfbox.fontcache=/data/local/dotsecure -Dlog4j2.formatMsgNoLookups=true -Djava.library.path=/usr/lib/$( uname -m )-linux-gnu/ -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahUncommitDelay=1000 -XX:ShenandoahGuaranteedGCInterval=10000 "}

spbolton avatar Aug 30 '22 21:08 spbolton