Page 1 of 1

How to safely remove java with lots of dependencies

Posted: 2018/04/25 14:48:36
by phil.e
Hello,

I've got some CentOS 6.9 workstations that have multiple versions of Java installed - 1.5, 1.6, and 1.7. I would like to remove 1.5 and 1.6, and leave just 1.7, but when I go to do a "yum erase" on the 1.5, yum lists 89 packages that are dependent on it - 1.6 and 1.7 only list their own associated java packages.
These workstations were originally built several years ago and I'm guessing 1.5 was the installed java version at the time, and those packages established their java dependencies based on 1.5. I suspect removing 1.5 is going to break all those apps that are using it.
How can I safely get rid of 1.5?
And if the only dependency 1.6 has is openjdk-devel, should that be an easy removal?

Thanks,
Phil.e

Re: How to safely remove java with lots of dependencies

Posted: 2018/04/25 16:22:18
by TrevorH
Are you sure you have the equivalent package set installed for 6, 7 or 8 that you have currently installed for 5?

Hmm, the only java-1.5.0 packages left that I see in the repos are for gcj and I'm fairly sure that's gone form newer openjdk versions.

Post the output of the yum remove.

Re: How to safely remove java with lots of dependencies

Posted: 2018/04/25 16:56:56
by phil.e
The vast majority of the dependencies appear to be related to the Eclipse java development environment they use.

I removed 1.5 on a test system, made a list of everything getting removed, and then went through the list and reinstalled all the deleted packages after 1.5 was gone. Eclipse looked like it came up all right, but, not being a developer, I can't do as thorough a test as the developers can.

Is there a more elegant way to get an application to point to a different version of java than jumping through all these hoops? (maybe too broad of a question - each app is probably different)

Re: How to safely remove java with lots of dependencies

Posted: 2018/04/25 17:30:02
by TrevorH
Install the equivalent newer package set first then remove the old ones.