GlobalMenuLib () { Application app; if (!SystemInfoRt.isLinux || !(CpuArch.isIntel64() || CpuArch.isArm64()) || (app = ApplicationManager.getApplication()) == null || app.isUnitTestMode() || app.isHeadlessEnvironment() || Boolean.getBoolean("linux.native.menu.force.disable") || (LoadingState.COMPONENTS_REGISTERED.isOccurred() && !Experiments.getInstance().isFeatureEnabled("linux.native.menu")) || !JnaLoader.isLoaded() || isUnderVMWithSwiftPluginInstalled()) { return null; } try { @SuppressWarnings("SpellCheckingInspection") Path lib = PathManager.findBinFile("libdbm.so"); assert lib != null : "DBM lib missing; bin=" + Arrays.toString(new File(PathManager.getBinPath()).list()); return Native.load(lib.toString(), GlobalMenuLib.class, Collections.singletonMap("jna.encoding", "UTF8")); } catch (UnsatisfiedLinkError ule) { LOG.info("disable global-menu integration because some of shared libraries isn't installed: " + ule); } catch (Throwable e) { LOG.error(e); } return null; }