--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -427,18 +427,22 @@ void os::init_system_properties_values()
   //        1: ...
   //        ...
   //        7: The default directories, normally /lib and /usr/lib.
+#ifdef DEB_MULTIARCH
+#define DEFAULT_LIBPATH	"/usr/lib/" DEB_MULTIARCH "/jni" ":/lib/" DEB_MULTIARCH ":/usr/lib/" DEB_MULTIARCH ":/usr/lib/jni:/lib:/usr/lib"
+#else
 #if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390)
-  #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
+  #define DEFAULT_LIBPATH "/usr/lib64/jni:/usr/lib64:/lib64:/usr/lib/jni:/lib:/usr/lib"
 #else
 #if defined(AARCH64)
   // Use 32-bit locations first for AARCH64 (a 64-bit architecture), since some systems
   // might not adhere to the FHS and it would be a change in behaviour if we used
   // DEFAULT_LIBPATH of other 64-bit architectures which prefer the 64-bit paths.
-  #define DEFAULT_LIBPATH "/lib:/usr/lib:/usr/lib64:/lib64"
+  #define DEFAULT_LIBPATH "/usr/lib/jni:/lib:/usr/lib:/usr/lib64/jni:/usr/lib64:/lib64"
 #else
-  #define DEFAULT_LIBPATH "/lib:/usr/lib"
+  #define DEFAULT_LIBPATH "/usr/lib/jni:/lib:/usr/lib"
 #endif // AARCH64
 #endif
+#endif
 
 // Base path of extensions installed on the system.
 #define SYS_EXT_DIR     "/usr/java/packages"
--- a/make/hotspot/lib/CompileJvm.gmk
+++ b/make/hotspot/lib/CompileJvm.gmk
@@ -131,6 +131,11 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TAR
   endif
 endif
 
+DEB_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || true)
+ifneq (,$(DEB_MULTIARCH))
+JVM_CFLAGS += -DDEB_MULTIARCH="\"$(DEB_MULTIARCH)\""
+endif
+
 ifeq ($(OPENJDK_TARGET_OS), windows)
   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
     RC_DESC := 64-Bit$(SPACE)
