Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

update-alternatives : update java path

Tags:

java

linux

ubuntu

I want to update the java path.After running the command

 sudo update-alternatives --config java

I get following :

        Selection    Path                                      Priority   Status
        ------------------------------------------------------------
          0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1         auto mode
          1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1         manual mode
        * 2            /usr/lib/jvm/jdk1.7.0_25/bin/java          1         manual mode

Now I want to update the path for jdk1.7.0_25.

what should i do?

like image 712
rachana Avatar asked Feb 13 '26 23:02

rachana


1 Answers

According to the man page there is no parameter for update-alternatives to change an entry. So you would have to remove your entry 2 with --remove and --install it again. Then you might have to --config the command again to point to the correct directory.

Alternatively, you can manually change the entry in /var/lib/dpkg/alternatives/java directly.

like image 99
Michael Lang Avatar answered Feb 15 '26 13:02

Michael Lang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!