1

I'm trying to change the JDK that the linux terminal is using to run jar files from 1.6 to 1.7. I'm trying to do this by using the command update-alternatives --config java which is giving me the following output:

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      auto mode
  1            /usr/bin/gij-4.7                                 1047      manual mode
  2            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode

However if I go to the directory /usr/lib/jvm I can see that java-7-openjdk-amd64 is present (among others).

What is the problem that is not causing this option to show when issuing the command update-alternatives --config java?

2 Answers 2

0

Maybe you have to add it as an option first?

This is from the man page.

update-alternatives --install link name path priority [--slave link name path]...

Add a group of alternatives to the system.

https://askubuntu.com/questions/233190/what-exactly-does-update-alternatives-do

1
  • I used the following command and got the following result sudo update-alternatives --install /usr/lib/jvm/java-7-jdk jdk-7 /usr/lib/jvm/jdk1.7.0_75/jre/bin/java 1062 update-alternatives: using /usr/lib/jvm/jdk1.7.0_75/ to provide /usr/lib/jvm/java-7-jdk (jdk-7) in auto mode but the option still doesn't show.
    – Colin747
    Commented Feb 25, 2015 at 14:48
0

I managed to add it to the list of options by running apt-get install openjdk-7-jdk

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .