jcefmaven / jcefbuild

Builds for JCef

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to build and install for Intellij Idea?

archenroot opened this issue · comments

I still don't much understand what is so special on this JCEF, that it won't be installed alongside with Intellij Idea distribution, but ok. I am on Gentoo system and would like to make my Markdown plugin in Intellij Idea working again.

I tried to run following command as suggested, but it failed:

11:52:35] zangetsu@zeus  $    /data/proj/jcefbuild   master  sh compile_linux.sh amd64 Release 
linux-latest: Pulling from friwidev/jcefdocker
eff15d958d66: Pull complete 
7769c8218092: Pull complete 
35dea76c406c: Pull complete 
ce43bd257de5: Pull complete 
bd0a72a85ed7: Pull complete 
2902fc762a5b: Pull complete 
Digest: sha256:60d7fd79579aba871840903570f96ccd6b3f220576cbf7288816823745c6e7fd
Status: Downloaded newer image for friwidev/jcefdocker:linux-latest
docker.io/friwidev/jcefdocker:linux-latest
unknown flag: --no-cache
See 'docker --help'.

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/home/zangetsu/.docker")
  -c, --context string     Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker
                           context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/home/zangetsu/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/home/zangetsu/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/home/zangetsu/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  builder     Manage builds
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at https://docs.docker.com/go/guides/

Total reclaimed space: 0B
mv: cannot stat 'out/jcef_build': No such file or directory
mv: cannot stat 'out/target': No such file or directory

any suggestion of what to be done to make this working welcomed.

commented

Hey there,

this error occurs because your docker version does not support the --no-cache option. So either it is not up to date and you can update it, or you could remove the flag and clean docker images before every build.

If you want to integrate JCEF in your plugin (and not modify it), have you considered to use jcefmaven from this organization? It saves you the building and integration process on many platforms and should run on gentoo too (even though it has not been tested there). I suggest you could give it a try ;)

commented

@archenroot JCEF seems to already be integrated with IntelliJ. Third-party plugins can use the bundled jcef using the jetbrains api for it: https://plugins.jetbrains.com/docs/intellij/jcef.html#enabling-jcef

If JCEF is not included with your intellij distribution you can still try to use jcefmaven. If its not included, I guess that is a gentoo thing.

@FriwiDev - well on my Gentoo Linux I get:
4:21 AM Not Support JCEF: Your environment does not support JCEF, cannot use Markdown Editor

This link really doesn't solve the issue: https://plugins.jetbrains.com/docs/intellij/jcef.html#enabling-jcef
It just says that this subsystem is built in Chrome dev tools...

But I found this topic:
https://intellij-support.jetbrains.com/hc/en-us/articles/360016421559-JCEF-the-missing-libs-problem-on-Linux

which states that there should be 2 files:

  • jbr/lib/libcef.so -- CEF/Chromium
  • jbr/lib/libjcef.so -- CEF bridge to JCEF

Now that is something I checked my system and I can only find libcef.so as Citrix ICA client dependency on my system...

zeus ~ # locate libcef
/data/devel/install/linuxx64-21.12.0.18/linuxx64/linuxx64.cor/cef/libcef.so
/home/zangetsu/ICAClient/linuxx64/cef/libcef.so
/usr/lib64/syslog-ng/libcef.so

still the second one is missing from my system libjcef.so

there is resolution to:

Resolve
Check https://pkgs.org for the correct package name and then install it:

$ sudo apt-get install libxss1
You can also search for the package name using aptitude:

$ sudo aptitude search libXss
(if aptitude is not installed, use sudo apt-get aptitude)

But above libxss1 is actually a screensaver lib: https://packages.debian.org/sid/libxss1
And quick search for libXss is similar to libxss1, all related to screensaver: https://pkgs.org/search/?q=libXss

So, it seems I need to look here to get this working: https://bitbucket.org/chromiumembedded/java-cef/wiki/BranchesAndBuilding

Now I am trying to build this repo: https://bitbucket.org/chromiumembedded/java-cef/src, one finding is that I cannot for some reason raise issue, as its incompatible with python 3.9 due to base64 decode issue:

6FromBase64EncryptionKey
    decoded_bytes = base64.decodestring(csek_encryption_key)
AttributeError: module 'base64' has no attribute 'decodestring'

Now I got into situation to have those missing jcef libs available on my system, probably just need to symlink them into /usr/lib64 space

[05:30:55] zangetsu@zeus  $    ~/tmp/src/jcef_build   master  ls native/Release/
chrome_100_percent.pak  icudtl.dat   libEGL.so     libvk_swiftshader.so  resources.pak      v8_context_snapshot.bin
chrome_200_percent.pak  jcef_helper  libGLESv2.so  libvulkan.so.1        snapshot_blob.bin  vk_swiftshader_icd.json
chrome-sandbox          libcef.so    libjcef.so    locales               swiftshader

I created symlinks into /usr/lib64 for both libjcef.so and libcef.so files, but that is not enogh it seem...
still getting:
5:36 AM Not Support JCEF: Your environment does not support JCEF, cannot use Markdown Editor

commented

@archenroot I am not sure that I can help you with your problem here. First of all, there are differences between the main JCEF library and the fork that JetBrains uses as JetbrainsCEF. Therefore I'd not be surprised if compiling using this repository against JetbrainsCEF failed. For your second step - installing your compiled copy in your installation - I think that there will most likely be some hard-coded integration happening within IntelliJ, so there is probably no way (without modifications to Jetbrains binaries) to install JCEF in IntelliJ on Gentoo. So you will probably need to wait until either Jetbrains supports Gentoo or find a way to create support yourself. This repository may be limited in what it can do for you, as it does not compile the JCEF you are looking for. Linking the shared libraries as you tried above will never be enough though, as CEF also requires a lot of resource files.

Thank you very much. Actually I contacted Intellij support and got response:
https://intellij-support.jetbrains.com/hc/en-us/requests/3757991?page=1

I was originally running graalvm and by reseting IDE VM to default there appear thos so files on my system:
zeus /var/log # locate jcef.so
/home/zangetsu/.jbr/jbr_dcevm-11_0_12-linux-x64-b1504.27/lib/libjcef.so
/home/zangetsu/.jbr/jbr_jcef-11_0_12-linux-x64-b1504.27/lib/libjcef.so

Now the error dissapeared about missing JCEF, but still markdown plugin showing no available interpreter which is seocndary issue which i need to resolve with Intellij as well.

Still thank you very much for your thoughts and hints. These thinks can be tricky, eg. mainstream vs fork versions, how to integrate, etc.