boolean () { boolean testModeEnabled = RegistryManager.getInstance().is("ide.browser.jcef.testMode.enabled"); synchronized (ourSupportedLock) { if (ourSupported != null && !testModeEnabled) { return ourSupported.get(); } if (testModeEnabled) { ourSupported = null; } else if (ourSupported != null) { return ourSupported.get(); } Function<String, Boolean> unsupported = (msg) -> { ourSupported = new AtomicBoolean(false); LOG.warn(msg + (!msg.contains("disabled") ? " (Use JBR bundled with the IDE)" : "")); return false; }; // warn: do not change to Registry.is(), the method used at startup if (!RegistryManager.getInstance().is("ide.browser.jcef.enabled")) { return unsupported.apply("JCEF is manually disabled via 'ide.browser.jcef.enabled=false'"); } if (GraphicsEnvironment.isHeadless() && !RegistryManager.getInstance().is("ide.browser.jcef.headless.enabled")) { return unsupported.apply("JCEF is manually disabled in headless env via 'ide.browser.jcef.headless.enabled=false'"); } if (!SKIP_VERSION_CHECK) { JCefVersionDetails version; try { version = JCefAppConfig.getVersionDetails(); } catch (Throwable e) { return unsupported.apply("JCEF runtime version is not supported"); } if (MIN_SUPPORTED_CEF_MAJOR_VERSION > version.cefVersion.major) { return unsupported.apply("JCEF: minimum supported CEF major version is " + MIN_SUPPORTED_CEF_MAJOR_VERSION + ", current is " + version.cefVersion.major); } if (MIN_SUPPORTED_JCEF_API_MAJOR_VERSION > version.apiVersion.major || (MIN_SUPPORTED_JCEF_API_MAJOR_VERSION == version.apiVersion.major && MIN_SUPPORTED_JCEF_API_MINOR_VERSION > version.apiVersion.minor)) { return unsupported.apply("JCEF: minimum supported API version is " + MIN_SUPPORTED_JCEF_API_MAJOR_VERSION + "." + MIN_SUPPORTED_JCEF_API_MINOR_VERSION + ", current is " + version.apiVersion.major + "." + version.apiVersion.minor); } } String altCefPath = System.getProperty("ALT_CEF_FRAMEWORK_DIR", null); if (altCefPath == null || altCefPath.isEmpty()) { altCefPath = System.getenv("ALT_CEF_FRAMEWORK_DIR"); } final boolean skipModuleCheck = (altCefPath != null && !altCefPath.isEmpty()) || SKIP_MODULE_CHECK; if (!skipModuleCheck) { URL url = JCefAppConfig.class.getResource("JCefAppConfig.class"); if (url == null) { return unsupported.apply("JCefAppConfig.class not found"); } String path = url.toString(); String name = JCefAppConfig.class.getName().replace('.', '/'); boolean isJbrModule = path != null && path.contains("/jcef/" + name); if (!isJbrModule) { return unsupported.apply("JCefAppConfig.class is not from a JBR module, url: " + path); } } ourSupported = new AtomicBoolean(true); return true; } }