0

Intro:

The following was done on a RHEL 6.9 32bit OS.

I installed the oracle (not openjdk) version of JRE rpm using the

rpm -Uvh

command.

I then built a package using rpmbuild that requires libjvm.so which is provided by the oracle JRE and verified this using the command.

rpm -ql jre1.8.0_111-1.8.0_111-fcs.i586

Problem:

However, when I go to install the rpm I built or use the command rpm -q libjvm.so I am getting told that libjvm.so is not installed.

I know I can put in the spec file for my rpm

AutoReqProv: no

to get around the dependency issue, however, that does not seem like good practice and I have also rebuilt the rpm database to no avail.

Question:

Thus I am left pondering and trying to solve, how the jre rpm says it provides libjvm.so yet the RPM database keeps saying that the dependency libjvm.so is not installed. Any ideas?

EDIT

The JRE rpm also provides the following

jaxp_parser_impl  
xml-commons-apis  
java  
java-1.8.0  
java-fonts  
jre  
jre-1.8.0  
jre1.8.0_111 = 1.8.0_111-fcs
  • What is the oracle RPM providing? rpm -ql lists the files; rpm -q --provides ... will show whether it "provides" the libjvm.so. For packages in yum you can also search via yum whatprovides '*/libjvm.so*' – thrig Jun 8 '17 at 15:07
  • @thrig added an edit for what that gave me. – jgr208 Jun 8 '17 at 15:27
  • That looks like the JRE rpm does not provide libjvm.so, hence the error. – thrig Jun 8 '17 at 16:00
  • @thrig that is strange though since the package does work. is there a way to tell it to only not auto include that dependency and no others in the spec file or is that not possible? – jgr208 Jun 8 '17 at 16:09
1

The libjvm.so requirement in the OpenJDK packages comes from

$ rpm -qp --provides java-1.8.0-openjdk-headless-1.8.0.121-1.b13.el6.x86_64.rpm \
  2>/dev/null | grep libjvm
libjvm.so()(64bit)
libjvm.so(SUNWprivate_1.1)(64bit)

which the Oracle RPM by contrast does not provide. Apart from removing that requirement from the package you are building (either with the hammer that is AutoReqProv or more complicated options involving the dependency scripts) another option is to create a shim package that does nothing more than provide the necessary requirement (and possibly to Conflict with OpenJDK).

Name:           shim-libjvm
Version:        1
Release:        1%{?dist}
Summary:        Shim for libjvm

Group:          Development/Languages
License:        CC BY-SA 3.0
URL:            http://example.org

Provides:       libjvm.so

BuildArchitectures: noarch

%description
Shim for libjvm

%install
mkdir -p %{buildroot}/usr/share/doc/shim-libjvm
echo "shim-libjvm is merely a provider for libjvm.so" > %{buildroot}/usr/share/doc/shim-libjvm/README


%files
%doc
/usr/share/doc/shim-libjvm/README

%changelog
* Thu Jun  8 2017 John Doe <jdoe@example.org>
- Release on a mostly unsuspecting world.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.