Bug 2009974 - libjvm.so not found
Summary: libjvm.so not found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: R
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-02 15:10 UTC by Iñaki Ucar
Modified: 2022-04-04 16:05 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-04-04 16:05:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Iñaki Ucar 2021-10-02 15:10:09 UTC
This is very strange: since the latest update, if I install an R package compiled against the openjdk in a clean system, it fails to load because it doesn't find libjvm.so. Reporting against the openjdk because nothing has changed in the R spec, and reporting against rawhide because it fails for all versions. Steps to reproduce, e.g., with Fedora 34:

$ podman run fedora:34
$ dnf install 'dnf-command(copr)'
$ dnf copr enable iucar/cran
$ dnf install R-CRAN-rJava
$ Rscript -e 'library(rJava)'
Error: package or namespace load failed for ‘rJava’:
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/usr/local/lib/R/library/rJava/libs/rJava.so':
  libjvm.so: cannot open shared object file: No such file or directory
Execution halted

Interestingly enough,

$ dnf install R-java
$ Rscript -e 'library(rJava)'

and the package loads correctly. Even more interestingly,

$ dnf uninstall R-java
$ Rscript -e 'library(rJava)'

and the package still loads correctly. So my guess is that the installation of R-java (which, please note, is an *empty* package) triggers something that should be triggered when Java is installed.

Comment 1 Iñaki Ucar 2021-10-29 13:46:16 UTC
Adding @spot to the CC. Maybe the R spec is doing something wrong, but this used to work. Simpler example:

$ podman run --rm -it fedora:32
# dnf -y install R
# ll $(R CMD config JAVA_HOME)
lrwxrwxrwx. 1 root root 21 Oct 29 13:31 /usr/lib/jvm/jre -> /etc/alternatives/jre

However, since F33 on (so I suspect this is since some recent Java 11 update):

$ podman run --rm -it fedora:33
# dnf -y install R
# ll $(R CMD config JAVA_HOME)
ls: cannot access '/usr/lib/jvm/java-11-openjdk-11.0.11.0.9-0.fc33.x86_64': No such file or directory

Wrong path. The R spec uses %{_jvmdir} in %post to set the proper paths: https://src.fedoraproject.org/rpms/R/blob/rawhide/f/R.spec#_861. So apparently %{_jvmdir} takes a wrong path?

Comment 2 Iñaki Ucar 2021-10-29 15:10:44 UTC
I found the issue. Alternatives creation was moved to posttrans:

- https://src.fedoraproject.org/rpms/java-11-openjdk/blob/rawhide/f/java-11-openjdk.spec#_2503
- https://src.fedoraproject.org/rpms/java-1.8.0-openjdk/blob/rawhide/f/java-1.8.0-openjdk.spec#_2674

So the call to javareconf must be moved to posttrans too. Issue moved to the R component.

Comment 3 Ben Cotton 2022-02-08 21:27:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 4 Iñaki Ucar 2022-04-04 16:05:38 UTC
This was fixed in https://src.fedoraproject.org/rpms/R/pull-request/6


Note You need to log in before you can comment on or make changes to this bug.