我正在尝试使用 yum 安装依赖于 Java 1.7 的软件包。我的机器上确实有 Java 7:
#echo $JAVA_HOME
$JAVA_HOME
/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
# java -version
java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (rhel-2.3.4.1.el6_3-x86_64)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
但yum
仍然抱怨找不到java 1.7
:
--> Finished Dependency Resolution
Error: Package: <some package>
Requires: jre >= 1.7.0
Available: java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64 (base)
jre = 1.5.0
Available: 1:java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64 (base)
jre = 1.6.0
Available: 1:java-1.6.0-openjdk-1.6.0.0-1.48.1.11.3.el6_2.x86_64 (updates)
jre = 1.6.0
Available: 1:java-1.6.0-openjdk-1.6.0.0-1.49.1.11.4.el6_3.x86_64 (updates)
jre = 1.6.0
Available: 1:java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64 (updates)
jre = 1.6.0
You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
<some package>.noarch has missing requires of jre >= ('0', '1.6.0', None)
知道是什么原因造成的吗?谢谢,
答案1
我知道您安装了 java,但也许您应该尝试运行sudo yum install java
以确保 yum“记得”安装它。
编辑
您也可以尝试运行sudo rpmdb --rebuilddb
以重建 rpm 数据库。