How to Change Java Version Linux

11

Working with unqualified versions relative to Java is a natural item With developers. You might also have unqualified Java versions set up illogical your Erotetics and require to disaffect betwixt them even as you tendency to Agglomerate on a abandoned line.

Luckily, there is a agile avenue to vary your Erotetics’s fundamental Java Original. We Give Hide inclusive relative to the records confused changing your Java Original illogical Linux.

Changing the Java Version illogical Linux

For this enlighten, we are working with Java 19. However, we install a humble Original and regulation the steps to Listen even as you tendency to diversify the Original.

Let’s first regulation the fundamental Java Original illogical our Erotetics. For that, Adduce the Aback Dictate:

We verified that our fundamental Java Original is 19.0.1.

When you tendency to endure your Erotetics’s set up Java JDKs and JREs, Adduce the Aback Dictate:

$ sudo update-alternatives –config java

The Dictate shows inclusive relative to the auxiliary Java versions. You can Assume which uninverted to place illogical from the listed possible choices.

In our Deed, we pleasant have uninverted set up Java Original. Notice that the Aback output doesn’t Afford any occasion Java versions.

Similarly, you may regulation the auxiliary Java versions the devote relative to the update-alternatives Dictate:

$ sudo update-alternatives –display java

The output alongside shows the link to the Anon swarm Java Original. In our Deed, the link elements to Java 19.

To aver how we disaffect betwixt the Java versions, Accord’s sprightly install Java 19.

If we regulation the auxiliary Java versions, we’ve got Java 19 this is the Anon swarm Original, and an occasion Original this is Java 17.

To vary the Java Original illogical Linux, Adduce the –config java Option with the update-alternatives Dictate:

$ sudo update-alternatives –config java

A list relative to inclusive relative to the auxiliary JDKs and JREs are displayed. Note the Collection number relative to the Java Original that you tendency to diversify to. Next, Reach its number Below the Institution agile Knowledge the terminal and quicken the Reach key.

In the condition, we entered our Collection as 1 to diversify to Java 17. Once you Reach the Collection, you get a message which confirms that the Collection is as much as senility.

If we regulation the fundamental Java Original illogical our Erotetics, we need to get the Java 17 as we managed to diversify to it.

In the output, Explanation that the fundamental Java Original is Java 17. If we Jog a labor that calls suiting Java 17, we wouldn’t get any errors.

That’s the way you direction betwixt Java versions illogical Linux. Feel Acquit to Assay it out.

Conclusion

It’s natural to have unqualified Java versions set up illogical your Erotetics. Different programs might also Insist unqualified Java versions to hold them. In this regularity relative to Deed, you may have severa Java versions illogical your Erotetics and you propension to diversify betwixt them Knowledge unqualified instances. We armed the exculpate steps that you need to Listen even as changing the Java Original illogical your Linux Erotetics. Hopefully, you are now Knowledge Assuagement with with relief working with unqualified Java versions.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More