While running a spring boot 3 native application on bellsoft-liberica-vm-core-openjdk17-22.3.0 I'm getting this following error after creating the image.
./target/blog: error while loading shared libraries: libfreetype.so: cannot open shared object file: No such file or directory
mvn -Pnative native:compile
to create the image.
./target/blog
to start the image.
Might be a bit late, but I recently faced the same problem (using Ubuntu 22.04).
apt-get install libfreetype-dev
will install the required library.
Or you might create a symlink to point to another installed version, as described here: https://stackoverflow.com/a/34257466
(libfreetype6
may already be installed, otherwise it may be via apt-get install libfreetype6
).
$ dpkg -L libfreetype6
/usr/lib/x86_64-linux-gnu/libfreetype.so.6
$ ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so.6 ~/tmp/lib/libfreetype.so
$ LD_LIBRARY_PATH=~/tmp/lib ./build/native/nativeCompile/myAppNativeImage