Saturday 2 February 2013

Using Oracle Java with libreoffice Fedora 18

Problem I was having was that I didn't want openjdk installed as I need Oracle's Java environment to be able to develop some android apps. I am not fully sure if I needed to remove the installation of the openjdk I guess I didn't and all I needed to do was to update the links and environment variables to point to the installation of Oracles Java. Anyhow I removed the openjdk instead and this is how I did it.

What I did here was to remove the installation of the openjdk without it trying to remove the libreoffice using following command. Use the appropriate version of the openjdk to remove it.

rpm -ev --nodeps java-1.7.0-openjdk

The --nodeps will remove the package without the libreoffice.

Now I installed Oracle's Java rpm downloaded from JavaSE Download, just by double clicking it, it then installs it. After completion of the installation, libreoffice seems fine and so does my development environment.

You can check which version of java is wired up if your not sure, by using the command:

java -version

When I was trying to do this I managed to get myself into a pickle with versions of java being installed, as I couldn't remove Oracle's Java using the software tool in Fedora 18. The software tool seemed to crash all the time, so I removed Oracle's Java from the command line instead, I used the following commands:

rpm -qa | grep jdk                            (This to find out the name of the package I wanted to remove)
rpm -ev jdk-1.7.0_13-fcs.x86_64    (This to remove the above package)

for some reason the software tool wasn't updated with the removal of the package but I ignored it for now.
So I found I had to do the order of removing the openjdk package, which I believe removes all the environment for java, so then installing Oracle's Java would reset them and then libreoffice continued to work.

I also imagine if there are any updates in the future that require openjdk to be installed it will be installed and thus wiping your Oracles Java environment variables. I haven't found this yet, but I am sure all I would need to do to reset them is too re-follow the above.

Remove openJDK, Remove Oracle Java, Re-Install Oracle Java. 

Hope this helps someone else too. :-)