How to Install JDK in Linux
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.
Update 04 March 2020
You should read it
- How to Install Java on Linux
- How to Set the Path in Java
- What is Java? Why choose Java?
- How to Install Oracle Java JRE on Ubuntu Linux
- How to Download Java to Internet Explorer
- Basic Java syntax
- 106 tips with Microsoft Office - Part 3
- How to Optimize Windows Vista
- How to Upgrade Oracle Java on Ubuntu Linux
- Press type in C
- What is JAVA file? How to open, edit and convert JAVA files
- eQuiz - Multiple choice quiz about JAVA
Maybe you are interested
Thousands of iOS apps could be at risk because of an open source vulnerability The strange forest area looks like a chessboard when viewed from above Impressive image: ISS International Space Station flies over the Sun. Russian spacecraft 'resupply' successfully 3 tons of cargo for the ISS in just 3 hours How clean are astronauts keeping the space station? There will soon be a 'green vegetable garden' on the International Space Station (ISS)