diff --git a/source/net/filebot/mediainfo/MediaInfoLibrary.java b/source/net/filebot/mediainfo/MediaInfoLibrary.java index fd236808..3c90bf17 100644 --- a/source/net/filebot/mediainfo/MediaInfoLibrary.java +++ b/source/net/filebot/mediainfo/MediaInfoLibrary.java @@ -16,8 +16,13 @@ interface MediaInfoLibrary extends Library { // libmediainfo for linux depends on libzen, so we need to load dependencies first, because we know where our native libs are (e.g. Java Web Start Cache). // if we do not, the system will look for dependencies, but only in the library path + + // Ensure JNA 4.x compatibility (i.e. use JNA package on Linux) + @SuppressWarnings("deprecation") Library LIB_ZEN = Platform.isLinux() ? (Library) Native.loadLibrary("zen", Library.class) : null; + // Ensure JNA 4.x compatibility (i.e. use JNA package on Linux) + @SuppressWarnings("deprecation") MediaInfoLibrary INSTANCE = (MediaInfoLibrary) Native.loadLibrary("mediainfo", MediaInfoLibrary.class, singletonMap(OPTION_FUNCTION_MAPPER, new FunctionMapper() { @Override diff --git a/source/net/filebot/platform/gnome/NativeGVFS.java b/source/net/filebot/platform/gnome/NativeGVFS.java index fc56ede4..0d9bb51b 100644 --- a/source/net/filebot/platform/gnome/NativeGVFS.java +++ b/source/net/filebot/platform/gnome/NativeGVFS.java @@ -8,6 +8,8 @@ import com.sun.jna.Pointer; public class NativeGVFS implements GVFS { + // Ensure JNA 4.x compatibility (i.e. use JNA package on Linux) + @SuppressWarnings("deprecation") private static final LibGIO lib_gio = (LibGIO) Native.loadLibrary("gio-2.0", LibGIO.class); private static final Pointer gvfs = lib_gio.g_vfs_get_default(); diff --git a/source/net/filebot/platform/mac/xattr/XAttr.java b/source/net/filebot/platform/mac/xattr/XAttr.java index 91d149d8..7d2eae2d 100644 --- a/source/net/filebot/platform/mac/xattr/XAttr.java +++ b/source/net/filebot/platform/mac/xattr/XAttr.java @@ -6,8 +6,7 @@ import com.sun.jna.Pointer; public interface XAttr extends Library { - // load from current image - XAttr INSTANCE = Native.loadLibrary(null, XAttr.class); + XAttr INSTANCE = Native.load(null, XAttr.class); // see /usr/include/sys/xattr.h int XATTR_NOFOLLOW = 0x0001; diff --git a/source/net/filebot/platform/windows/Kernel32.java b/source/net/filebot/platform/windows/Kernel32.java index 5fee71d9..630d932e 100644 --- a/source/net/filebot/platform/windows/Kernel32.java +++ b/source/net/filebot/platform/windows/Kernel32.java @@ -9,7 +9,7 @@ import com.sun.jna.win32.W32APIOptions; public interface Kernel32 extends StdCallLibrary { - Kernel32 INSTANCE = Native.loadLibrary("kernel32", Kernel32.class, W32APIOptions.DEFAULT_OPTIONS); + Kernel32 INSTANCE = Native.load("kernel32", Kernel32.class, W32APIOptions.DEFAULT_OPTIONS); long APPMODEL_ERROR_NO_PACKAGE = 15700; long ERROR_INSUFFICIENT_BUFFER = 122;