It's true that you have a JDK, but it is not in the RPM database, which is used by yum and other similar automatic package managers to know what packages are installed and get there respective versions.
The best solution may be running sudo yum install jdk
so you can get a version with yum and rpm.
You can also consider following its suggestion to add the --skip-broken
option, however it shares the problem with the second point in P.S.
Running the rpm -Va
stuff may help RPM find missing packages and files. If you believe that you installed Java with RPM, try it.
P.S.: At first I considered creating a dummy package like what dpkg users may do, however:
- It's quite complicated to make a package under RPM, since you will have to write a long spec. RPM also uses the file list to look for library dependencies, so you have to give it quite a long file list.
Possible workaround: Automatic %files
generation with find
and a lot of shell.
- Even though you completed making a dummy package and installed it, your package is quite likely to be unable to find your java, if it uses some hard-encoded logic to navigate to the Java installed by the jdk package. (Most packagers don't use a weird directory like
/user
, and if you are unlucky enough to find a package written by a guy who doesn't know any java_home
stuff…)
Possible workaround: symlinking.
Update:
It seems that the package name of your JDK is jdk1.8.0_25
. Since you already have one installed with RPM, it would be much easier and cleaner to create a dummy package, although it is still somehow a dirty hack.
Just write a spec for the package jdk
of the reqired version, and make it depend on jdk1.8.0_25
. Then add some symlinks to the %files
block so your program can find it. Finally, really create the symlinks and do rpmbuild -bb dummy_jdk.spec
.
/usr/java/jdk1.8.0_25
? – John Jun 10 '15 at 14:37which java
? If it shows a valid binary in/usr/jva/jdk1.8.0_25
, what is the output ofrpm -qf ${binary}
where ${binary} is the output of thewhich
command? – John Jun 10 '15 at 14:45rpm -qa | grep jdk
show? – John Jun 10 '15 at 14:46which java
returns/usr/bin/java
rather than a location within the/usr/java/jdk1.8.0_25
directory.rpm -qf /usr/bin/java
prints thatjava
is not owned by any package.rpm -qa | grep jdk
printsjdk1.8.0_25-1.8.0_25-fcs.x86_64
– scottysseus Jun 10 '15 at 14:49