-2

I am using ubuntu 18 and have multiple versions of java and python installed, How do I change my default version.

1 Answers1

2

Use the following command to list the available options

sudo update-alternatives --config java

it will ask to choose from the available versions

just enter the selection number and bingo your default java version is changed.

but the same might not work for python

sudo update-alternatives --config python

might give an error no alternatives for python

To change default python to python3

update-alternatives --install /usr/bin/python python /usr/bin/python3.6 10

10 here represents the weight, you can give any number of your choice