Question

I'm using a system that has various java versions installed and uses the "alternatives" command to switch between them. I know that I can change the Java version using this command:

alternatives --config java

Where 'java' is the name for that list of alternatives. I'm interested in finding the list of names for all alternatives currently installed. For example, I know that 'alternatives' also manages a link to the jdk directory, but I can't figure out the name to give to --config so that I can choose an alternative.

How do I get a list of names of alternatives on a linux system?

Was it helpful?

Solution

I just discovered that:

"Metadata about the alternatives system can be found in the administrative directory, which defaults to /var/lib/alternatives."

I found that information at this URL: http://www.quora.com/Alternatives-Linux-command/How-does-the-alternatives-system-work

Each file in that directory represents a 'name' for an alternative. It turns out that alternatives can manage more than just the link to a single binary. It can manage related paths too!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top