Skip to content

How to Switch Between Multiple Java Versions on Debian

Category
Linux
Covers
Debian, Java
Versions & support
About Java →, About Debian →

This tutorial helps you to switch between multiple Java versions on Debian system. For example, you have installed multiple Java versions on your Debian Linux system. Now you want to switch to other Java version as default Java.

Use update-alternatives command to set default Java version as following command:

sudo update-alternatives --config java

According to the above screenshot, I have selection option 2 which will set Oracle Java 8 as default Java version on your system. You can use java -version command to view default version.

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top