问题
One my linux instance, I am trying to install JDK 7 using the rpm. There is already JRE 6 installed, and I want to install JDK 7 along that. When I try to install JDK 7, getting the following error:
# rpm -ivh jdk-7u3-linux-x64.rpm
Preparing... ########################################### [100%]
file /etc/init.d/jexec from install of jdk-2000:1.7.0_03-fcs.x86_64 conflicts with file from package jre-1.6.0_20-fcs.x86_64
I also tried installing using yum using:
# yum install jdk-7u3-linux-x64.rpm
This resulted in Transaction check error:
Transaction Check Error:
file /etc/init.d/jexec from install of jdk-2000:1.7.0_03-fcs.x86_64 conflicts with file from package jre-1.6.0_20-fcs.x86_64
Can someone help me to get this installed. I HAVE to retain already installed JRE 6, so removing that is not the solution for me.
Any help will be appreciated!
Thanks
Noman A.
回答1:
I just had the same problem when using YUM.
The key is to use rpm followed by the --force flag, i.e. you first install the JRE 1.6 (which you have already) and then issue an rpm command like this
rpm -ivh jdk-7u3-linux-x64.rpm --force
It then installs the newer JDK not minding any error.
The file /etc/init.d/jexec is exactly the same between both java versions.
回答2:
Did not find any solution to this, so I went ahead and installed JDK using the tar file available for the respective JDK version.
-Noman A.
来源:https://stackoverflow.com/questions/10270380/transaction-check-error-when-installing-sun-jdk-7