Change:
<ins> { fetchFromGitHub , fetchurl , fetchzip , stdenv , cmake , python3 , jdk17 , git , libcef , rsync , lib , ant , ninja , debugBuild ? false , glib , nss , nspr , atk , at-spi2-atk , libdrm , expat , libxcb , libxkbcommon , libX11 , libXcomposite , libXdamage , libXext , libXfixes , libXrandr , mesa , gtk3 , pango , cairo , alsa-lib , dbus , at-spi2-core , cups , libxshmfence , udev }: assert !stdenv.isDarwin; # I can't test darwin let rpath = lib.makeLibraryPath [ glib nss nspr atk at-spi2-atk libdrm expat libxcb libxkbcommon libX11 libXcomposite libXdamage libXext libXfixes libXrandr mesa gtk3 pango cairo alsa-lib dbus at-spi2-core cups libxshmfence udev ]; buildType = if debugBuild then "Debug" else "Release"; in stdenv.mkDerivation rec { name = "jcef-jetbrains"; rev = "153d40c761a25a745d7ebf0ee3a024bbc2c840b5"; commit-num = "611";  # Run `git rev-list --count HEAD` nativeBuildInputs = [ cmake python3 jdk17 git rsync ant ninja ]; buildInputs = [ libX11 libXdamage nss nspr ]; src = fetchFromGitHub { owner = "jetbrains"; repo = "jcef"; inherit rev; hash = "sha256-Vud4nIT2c7uOK7GKKw3plf41WzKqhg+2xpIwB/LyqnE="; }; cef-bin = let fileName = "cef_binary_104.4.26+g4180781+chromium-104.0.5112.102_linux64_minimal"; urlName = builtins.replaceStrings ["+"] ["%2B"] fileName; in fetchzip rec { name = fileName; url = "https://cef-builds.spotifycdn.com/${urlName}.tar.bz2"; hash = "sha256-0PAWWBR+9TO8hhejydWz8R6Df3d9A/Mb0VL8stlPz5Q="; }; clang-fmt = fetchurl { url = "https://storage.googleapis.com/chromium-clang-format/942fc8b1789144b8071d3fc03ff0fcbe1cf81ac8"; hash = "sha256-5iAU49tQmLS7zkS+6iGT+6SEdERRo1RkyRpiRvc9nVY="; }; configurePhase = '' runHook preConfigure patchShebangs . cp -r ${cef-bin} third_party/cef/${cef-bin.name} chmod +w -R third_party/cef/${cef-bin.name} patchelf third_party/cef/${cef-bin.name}/${buildType}/libcef.so --set-rpath "${rpath}" --add-needed libudev.so patchelf third_party/cef/${cef-bin.name}/${buildType}/chrome-sandbox --set-interpreter $(cat $NIX_BINTOOLS/nix-support/dynamic-linker) sed 's/-O0/-O2/' -i third_party/cef/${cef-bin.name}/cmake/cef_variables.cmake sed  -e 's|os.path.isdir(os.path.join(path, x27.gitx27))|True|'  -e 's|"%s rev-parse %s" % (git_exe, branch)|"echo '${rev}'"|'  -e 's|"%s config --get remote.origin.url" % git_exe|"echo 'https://github.com/jetbrains/jcef'"|'  -e 's|"%s rev-list --count %s" % (git_exe, branch)|"echo '${commit-num}'"|'  -i tools/git_util.py cp ${clang-fmt} tools/buildtools/linux64/clang-format chmod +w tools/buildtools/linux64/clang-format mkdir jcef_build cd jcef_build cmake -G "Ninja" -DPROJECT_ARCH="x86_64" -DCMAKE_BUILD_TYPE=${buildType} .. runHook postConfigure ''; outputs = [ "out" "unpacked" ]; postBuild = '' export JCEF_ROOT_DIR=$(realpath ..) ../tools/compile.sh linux64 Release ''; # Mostly taken from jb/tools/common/create_modules.sh installPhase = '' runHook preInstall export JCEF_ROOT_DIR=$(realpath ..) export OUT_NATIVE_DIR=$JCEF_ROOT_DIR/jcef_build/native/${buildType} export JB_TOOLS_DIR=$(realpath ../jb/tools) export JB_TOOLS_OS_DIR=$JB_TOOLS_DIR/linux export OUT_CLS_DIR=$(realpath ../out/linux64) export TARGET_ARCH=x86_64 DEPS_ARCH=amd64 export OS=linux export JOGAMP_DIR="$JCEF_ROOT_DIR"/third_party/jogamp/jar mkdir -p $unpacked/{jogl,gluegen,jcef} function extract_jar { __jar=$1 __dst_dir=$2 __content_dir="''${3:-.}" __tmp=.tmp_extract_jar rm -rf "$__tmp" && mkdir "$__tmp" ( cd "$__tmp" || exit 1 jar -xf "$__jar" ) rm -rf "$__tmp/META-INF" rm -rf "$__dst_dir" && mkdir "$__dst_dir" if [ -z "$__content_dir" ] then cp -R "$__tmp"/* "$__dst_dir" else cp -R "$__tmp"/"$__content_dir"/* "$__dst_dir" fi rm -rf $__tmp } cd $unpacked/gluegen cp "$JOGAMP_DIR"/gluegen-rt.jar . cp "$JB_TOOLS_DIR"/common/gluegen-module-info.java module-info.java javac --patch-module gluegen.rt=gluegen-rt.jar module-info.java jar uf gluegen-rt.jar module-info.class rm module-info.class module-info.java mkdir lib extract_jar "$JOGAMP_DIR"/gluegen-rt-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH" cd ../jogl cp "$JOGAMP_DIR"/gluegen-rt.jar . cp "$JOGAMP_DIR"/jogl-all.jar . cp "$JB_TOOLS_OS_DIR"/jogl-module-info.java module-info.java javac --module-path . --patch-module jogl.all=jogl-all.jar module-info.java jar uf jogl-all.jar module-info.class rm module-info.class module-info.java mkdir lib extract_jar "$JOGAMP_DIR"/jogl-all-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH" cd ../jcef cp "$OUT_CLS_DIR"/jcef.jar . mkdir lib cp -R "$OUT_NATIVE_DIR"/* lib mkdir $out runHook postInstall ''; dontStrip = debugBuild; postFixup = '' cd $unpacked/gluegen jmod create --class-path gluegen-rt.jar --libs lib $out/gluegen.rt.jmod cd ../jogl jmod create --module-path . --class-path jogl-all.jar --libs lib $out/jogl.all.jmod cd ../jcef jmod create --module-path . --class-path jcef.jar --libs lib $out/jcef.jmod ''; meta = { description = "Jetbrains' fork of JCEF"; license = lib.licenses.bsd3; homepage = "https://github.com/JetBrains/JCEF"; }; } </ins>

Discussion:
The JetBrains JDK seems to be built without JCEF support. Steps to reproduce the behavior: something (e.g. Intellij) with the JetBrains JDK JCEF to work. doesn't. JCEF should be supported. This is probably the cause of , and . <!-- Please @ people who are in the list of the offending package or module. If in doubt, check for whoever last touched something. -- Please run and paste the result.
I tried to build JBR with JCEF multiple times, but got stuck providing the JCEF binaries in the required format. There doesn't seem to be any documentation on how to get them, and jetbrains gets them from somewhere within their infra IIRC. I wasn't able to reproduce them with their JCEF fork repo. For the time being, I'm using a patched binary from them: where sources is This is using jbr 17.0.2 though. You can check for releases of it at It should be easy to adapt this to jbr 11.x. With the following overlay: You can use it with jetbrains editors (I'm only using idea-ultimate, YMMV with other products). Note that JetBrains wasn't prepared for the "suprising" deprecation of illegal reflection access in Java 17, which requires untold amounts of --add-opens. Not sure if all are still necessary, and if some are missing which I didn't notice because I never used a particular feature. Good luck This overlay also adds some runtime deps that were missing, python3 is required these days for "restarter". For example when clearing caches, you wouldn't get the button "clear & restart" but "clear & exit", but it's not really important AFAICS. wrapGAppsHook made some GTK warnings go away. is obviously a personal choice. The binary JBR differs quite a lot from the nixpkgs version. The latter does a normal jdk build, but with jetbrains sources. The jetbrains build (which is driven by - let's say interesting - shell scripts that comingle configuring, building, patching and modifying the resulting archives in place) behaves differently beyond JCEF availability. In particular, they try to do automatic DPI scaling and their heuristics catastrophically failed on my system.

JCEF seems to work for me (rendering Markdown preview) !
Thanks for this! I have adjusted it to use JDK 11 for now, and it works wonderfully, aside from my cursor theme being ignored (but hey, markdown preview and better js debugger are very nice). Perhaps we can consider going back to using the binary instead of building from source in nixpkgs? I know source builds are preferred, but the JCEF support is a big reason one would use the JetBrains JDK over the normal JDK.
I remember hitting the cursor theme bug, when I was using a HiDPI config that scaled the cursor (I'm not anymore). It might be , and I don't think I found a fix in the build (a user in that ticket worked around the issue with a fhs env for idea).
It seems we should build () first. Then build , the JetBrains fork (). Last, we opt-in JCEF in JetBrains JDK build process, and got the JB JDK with JCEF, which can rendered Markdown doc. Given the complexity of the process, I recommend make a new pkgs , or only use JB JDK with JCEF binary in JetBrains products only, it seems JB IDE contains FHS Env already.
That's works fine for me, I tested on: + jbr .
I tried twice to build CEF+JCEF, but got frustrated and setteled on patching the binary as I described above. Here is the latest stuff from my dead code archive (very rough, did get a derivation but it crashed at runtime IIRC). openjfx business is maybe not necessary anymore, as openjfx17 is available in nixpkgs meanwhile. Also the jdk build is the nixpkgs openjdk build with jetbrains additions, which didn't exist in version 17 back then. Maybe it would be better to rebase all of this on current openjdk17 again. Take a stab if you like, I'm pretty sure I won't Cheers Didn't even attempt to build it, as it looked like it would be way beyond my time budget for these things - basically like building chrome I guess, and maybe lots can be reused from nixpkgs' chromium ¯()/¯. So here is an attempt at patching the binary.

Ping me if you get something running
I recently got a problem similar to , where the cursor theme and size in my Xresources wasn't respected any longer. In addition to JBR getting patchelfed in, it must be in intellij-idea's . I've updated my intellij-idea derivation in accordingly. Additionally, I've had the chance to try out JBR11 builds, and they seem to work as well (with the derivation I gave above). To start intellij-idea with jbr 11, you could/should remove all the , and you can't use ZGC but must use another gc (e.g. or , optionally adding the recommended and if you are feeling adventurous ) Did you progress in your project packaging JBR from sources?
No... Packaging JBR from source basically ~= packaging chromium, I do not have such a powerful machine to do that : (
this is a fix I would really like to see. What needs to get done at this point to get this mainlined? I'd be interested in trying to figure that out.
I think someone just needs to open a PR for it You are talking about the patched binaries? I never got the build from source to work. I'm not sure if nixpkgs wants more haphazardly patched binary packages though, it would be much better to figure out the build. Also, the fixups I are a result of trial and error basically and I don't feel like I understand it enough to maintain it. Lastly, JetBrains Runtime 17 is not officially released as far as I understand, so it might be better to just add 11. The derivation seems to work for 11 by just updating the source, but there are probably some libraries extraneous or missing. Maybe I can make an overlay repo making it easier to consume in the meantime? is listed as the maintainer of jetbrains-jdk, maybe he can chime in.
if you were interested in making JCEF at least usable, I'd be happy to offer a bounty in the $200 range.

If that sounds interesting to you, shoot me an email at Totally fine if not, but I like to support open source I use when possible :)
Just wanted to chime in and say I've also managed to get the setup described working (the patched binary) Works like a charm with the (as of now) latest 17.0.4 binaries I just had to add and to the dependencies in the argument Thank you!
/ Does the setup still work for you? Do you have a fork of your nixpkgs by any chance? I'm unsure on where these files have to be located.
yes it does still work, here's a link to my (quite cursed, be warned) nixos config: i've a package for the jdk, which I then import and use in an overlay here there is also which seems almost ready to be merged
Thanks a lot for sharing