How to Install JDK in Linux
This wikiHow teaches you how to install the latest version of JDK (Java 12) on Debian, Ubuntu, and Linux Mint using the Linux Rising PPA repository. Press to open a new terminal window. If you're already at the command prompt, just skip to...
Table of Contents
Method 1 of 2:
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.[1] -
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.
Method 2 of 2:
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.
3.5 ★ | 2 Vote
Read More
- 5 reasons to install Linux on old computers
- How to install Kali Linux on macOS
- Steps to install Webex for Linux
- How to install NVIDIA drivers on Kali Linux
- 5 New Linux Apps Users Should Install Right From the Start
- How to install Kali Linux on Android using Linux Deploy
- How to install Windows Game on Linux with Winepak
- Instructions for installing basic Arch Linux
- How to install Kali Linux on your computer
- How to install Spotify on Linux
- How to Install VirtualBox on Linux
- How to install Deepin Linux
- How to Install Asahi Linux on an Apple Silicon Mac
- How to install and use TeamViewer on Linux