Standalone Installation on Rocky 9.1: "error while loading shared libraries" libjli.so
Setting up a new Rocky 9.1 Workstation on a laptop for development. Main objectives were installing IntelliJ IDEA Community and Android Studio. I'll outline my process below, including installation of Java 17 OpenJDK, which seems to be at the center of my problems.
ERROR OUTPUT from IDEA's bundled java package:
/opt/idea-IC-231.8109.175/jbr/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Output of where libjli.so:
libjli.so:
Manually Locate libjli.so in the following directory:
/usr/lib/jvm/java-17-openjdk-17.0.6.0.10-3.el9_1.x86_64/lib/
Please note, this is a fresh install which I can reformat / refresh as needed - and I'm happy to provide as much information as requested to resolve the issue. However, I'm fairly determined to use the applications identified above. I'm trying to avoid a debate on best alternative options - but if there's an absolute blocker to moving forward, please help me understand the reason.
Here are the details of my process to setup the OS and IDEA so far:
Used Rufus to create bootable media from following source:
https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.1-x86_64-dvd.iso
Clean Install using following options:
- Workstation, no add-ons
- Setup ROOT and password, no SSH
- Setup non-root-user and password, no Groups
- Setup WiFi Connection
- Setup "General Purpose" Security Policy
- Setup Hard Disk with Standard Provisioning, Default Directory + /usr/log/audit for Security Policy
Completed Installation, Initial Login as ROOT:
- $ usermod -aG wheel <non-root-user>
- Log Out, Reboot
Completed Reboot, Login as non-root-user:
- $ sudo dnf install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
- $ sudo dnf install java-17-openjdk java-17-openjdk-devel
- $ sudo update-alternatives --config java
- $ sudo update-alternatives --config javac
- $ sudo dnf update
- $ sudo fapolicyd-cli --update
- Log Out, Reboot
Completed Java Installation, OS Updates, Policy Updates - Login as non-root-user:
Output of uname -a:
Linux localhost.localdomain 5.14.0-162.6.1.el9_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 18 02:06:38 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of java --version
openjdk 17.0.6 2023-01-17 LTS
OpenJDK Runtime Environment (Red_Hat-17.0.6.0.10-3.el9_1) (build 17.0.6+10-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.6.0.10-3.el9_1) (build 17.0.6+10-LTS, mixed mode, sharing)
Output of javac --version:
javac 17.0.6
Output of whereis java:
java: /usr/bin/java /usr/lib/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz
Output of whereis libc.so.6:
libc.so.6: /usr/lib/libc.so.6 /usr/lib64/libc.so.6
Output of where libjli.so:
libjli.so:
Output of echo $PATH:
/home/<non-root-user>/.local/bin:/home/<non-root-user>/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
Download and Install IntelliJ IDEA using the following resources:
https://www.jetbrains.com/help/idea/installation-guide.html#standalone
- $ sudo tar -xzf ideaIC-2023.1.tar.gz -C /opt
- $ sudo /opt/idea-IC-231.8109.175/bin/idea.sh
ERROR OUTPUT from IDEA's bundled java package:
/opt/idea-IC-231.8109.175/jbr/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Manually Locate java and javac in the following directory:
/usr/lib/jvm/java-17-openjdk-17.0.6.0.10-3.el9_1.x86_64/bin/
Manually Locate libjli.so in the following directory:
/usr/lib/jvm/java-17-openjdk-17.0.6.0.10-3.el9_1.x86_64/lib/
At this point, I have reproduced the above steps on multiple passes. Following this point, I have followed various guides to set variables or symbolic links to no effect. In summary:
- Set JAVA_HOME in /etc/profile.d/java.sh or /.bashrc
- Set LD_LIBRARY_PATH in /etc/ld.so.conf.d/java.conf or /.bashrc (followed by commands as ROOT)
- Creating symbolic links for IDEA and/or JAVA
Apologies for such a lengthy post, but I'm hoping to get past a lot of the initial discovery questions which have been posed in some of the other forums I've searched for results. My current suspicions are as follows:
- Output of "whereis libjli.so" returns NULL, which seems like a major concern
- The "/jbr/bin/java" throwing the ERROR is the bundled package from the Intellij IDEA directory
I am not clear on how to move forward, given that all of the proposed solutions seem to fail me. Any guidance would be greatly appreciated.
Please sign in to leave a comment.
Regarding this error, I want to clarify that are you trying to run some java applications by JetBrains Runtime?
We do not recommend using JBR to build/run the projects, the guide at https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html describes how to download and set up a JDK for the project. While your suggestion could help, the proper solution would be to configure the JDK properly.
Ethan Yin I have not attempted to run any Java applications or code at this point, other than the standalone installation for the Intellij IDEA application. My intent was not to use the JBR for build/run of a specific project. The failure I'm experiencing is during the installation of the IDE - before any code has been written on the new Rocky Linux Workstation.
I suppose I am trying to run the standalone installation process, which is leveraging the JBR to call on libjli.so in the wrong location. I'll refer to the link you provided, and see if it helps me identify where I may have done something incorrectly. Thank you for the guidance, I'll post results or additional questions as soon as possible. Much appreciated!
Ethan Yin Following the link you sent, I attempted to use the jetbrains-toolbox instead of the standalone installation. I made two attempts - the first using the "Install the Toolbox" section as written, the second using the shell script at /nagygergo/jetbrains-toolbox-install. Both resulted in the following output:
$ sudo /opt/jetbrains-toolbox-1.27.3.14493/jetbrains-toolbox
./glibcversion: error while loading shared libraries: libc.so.6: cannot open shared object file: Operation not permitted /tmp/.mount_jetbraA3zYOd/AppRun: line 29: [: : integer expression expected
$ whereis libc.so.6:
libc.so.6: /usr/lib/libc.so.6 /usr/lib64/libc.so.6
$ sudo rpm -q
glibc glibc-2.34-40.el9_1.1.i686
glibc-2.34-40.el9_1.1.x86_64
$ sudo rpm -V glibc
....L.... c /etc/nsswitch.conf
....L.... c /etc/nsswitch.conf
This is with a non-root user which has sudo permissions. Instead of failing on libjli.so which is not found, it fails on libc.so.6 stating not permitted.
I've included some info above about glibc which I hope might provide some insight. Any suggestions would be greatly appreciated.
Issue Resolved. While I could not complete the Standalone Installation process, I was eventually able to use the Toolbox Application successfully. Upon reading the AppImage Wiki, the Rocky Linux instance was found to be missing the fontconfig.x86_64 package.
After using DNF to install the missing package, I was able to launch the Toolbox through GNOME. This allowed me to complete the installation of IntelliJ IDEA on Rocky 9 Workstation.