Can't install jdk on Fedora with yum nor with rpm

ぐ巨炮叔叔 提交于 2019-12-01 11:14:41

The problem here is that you cannot use the Oracle rpm to install JDK 7 when you already have the Oracle JDK 6 as it tries to install the /etc/init.d/jexec script which is already installed and required for JDK 6.

I would advise sticking to the tarball or self extracting *.bin and using JAVA_HOME if you are going to use the Oracle distribution as it does not have this problem and you will probably not need jexec anyway.

In general I would suggest that you install the Oracle JDK not the OpenJDK. Otherwise you might risk running into some issues. I always found problems of all sorts and sizes with OpenJDK that I don't even bother trying it any more.

Download the JDK RPM from here and follow the usual instructions. Its usually very straightforward and without problems.

Full detailed instructions including how to install it here.

Make sure you choose the right version you need (JDK 1.7 or JDK 1.6, dont mix) because from your question you seem to have a confusion of library versions from 1.5 to 1.7.

And another thing, uninstall whatever you have installed already before installing a fresh one to avoid conflicts.

Calapacho

Check my answer here Transaction check error when installing Sun JDK 7

Basically you may use rpm --force to install one JDK on top of the other. This scenario is completely valid specially when you have to develop for different JAVA versions.

Mike T

Just faced the same issue. I was not comfortable using --force command; did not want to risk messing-up the existing Java that came installed at system setup.

I ended up doing the following and running the app server with a different version of Java under a different user ID.

downloaded the Java tar.gz version and uncompressed:

tar -zxvf jdk-7u45-linux-x64.gz

Created the directory:

mkdir /usr/java/jdk1.7.0_45

Copied the contents to the new directory manually:

cp -r /.../jdk1.7.0_45/* /usr/java/jdk1.7.0_45

Set the java_home under the user ID home directory in .bashrc and .bash_profile files:

export JAVA_HOME=/usr/java/jdk1.7.0_45
export PATH=$JAVA_HOME/bin:$PATH
export PATH=$PATH:/usr/sfw/lib/gcc:/usr/sfw/bin 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!