How to Install JDK in Linux
How to Install JDK in Linux
This wikiHow will teach you how to install the latest version of JDK. The right way to install JDK will depend on whether you're using Ubuntu, Linux Mint, or Debian, but it's a straightforward process regardless, and we'll walk you through each method step-by-step! Check out the steps below to get started.
Steps

Using Ubuntu or Linux Mint

Press Ctrl+Alt+T to open a new terminal window. If you're already at the command prompt, just skip to the next step.

Type sudo add-apt-repository ppa:linuxuprising/java and press ↵ Enter. This adds the Linux Uprising repository.

Type sudo apt update and press ↵ Enter. Now that the repository is ready, you can use it to install JDK.

Type sudo apt install oracle-java12-installer and press ↵ Enter. JDK is now installed.

Type sudo apt install oracle-java12-set-default and press ↵ Enter. This sets Java 12 as the default Java version. To double-check the default version, type java --version at the command prompt and press ↵ Enter.

Using Debian

Press Ctrl+Alt+T to open a new terminal window. If you're already at the command prompt, just skip to the next step.

Type su - and press ↵ Enter.

Add the Linux Uprising repository. Here's how: Type echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic main" and press ↵ Enter. Type apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A and press ↵ Enter.

Type apt-get update and press ↵ Enter.

Type apt-get install oracle-java12-installer and press ↵ Enter.

Type exit and press ↵ Enter. JDK is now installed.

Type sudo apt install oracle-java12-set-default and press ↵ Enter. This sets Java 12 as the default Java version. To double-check the default version, type java --version at the command prompt and press ↵ Enter.

What's your reaction?

Comments

https://rawisda.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!