How to install Java in Ubuntu 14.04
Want to know how to install Java in Ubuntu 14.04? Installing Java is certainly one of the first few things to be done after Ubuntu 14.04 is installed (SEE), and this is also very simple.
Many people hate Java, but for some reason you may need to install Java, although you hate it. In this article, we will show you how to install Java on Ubuntu 14.04 (or Linux Mint 17 also applies ).
JRE vs OpenJDK vs Oracle JDK
Before continuing to learn how to install Java, Let's quickly understand the differences between JRE, OpenJDK, and Oracle JDK.
- JRE (Java Runtime Environment) is the Environment you need to run a Java-based application. If you are not a programmer, these are enough for your needs.
- JDK represents the Java Development Kit. If you want to develop Java (read the Program), this is exactly what you need.
- OpenJDK is an open-source implementation of Java development kit, and Oracle JDK is the official Oracle version of Java Development Kit. Although OpenJDK is sufficient for most cases, we recommend that you use Oracle JDK for many programs such as Android Studio to avoid UI/performance problems.
Check if Java has been installed on Ubuntu
Open the terminal and run the following command:
- Java-version
If you see the following output, it means that you have not installed Java:
- The program 'java' can be found in the following packages:
- * Default-jre
- * Gcj-4.6-jre-headless
- * Openjdk-6-jre-headless
- * Gcj-4.5-jre-headless
- * Openjdk-7-jre-headless
- Try: sudo apt-get install
Install Java on Ubuntu and Linux Mint
After reading different types of 'java', let's see how to install them.
Install JRE on Ubuntu and Linux Mint
Open the terminal and run the following command to install JRE:
- Sudo apt-get install default-jre
Install OpenJDK on Ubuntu and Linux Mint
On the terminal, run the following command to install the OpenJDK Java Development Kit:
- Sudo apt-get install default-jdk
Specifically, if you want to install Java 7 or Java 6 and so on, you can use openjdk-7-jdk/openjdk-6jdk, but remember to install openjdk-7-jre/openjdk-6-jre before that.
Install Oracle JDK on Ubuntu and Linux Mint
Use the following command to install it. It takes only some time to download many files, and you need to ensure that your network environment is good:
- Sudo add-apt-repository ppa: webupd8team/java
- Sudo apt-get update
- Sudo apt-get install oracle-java8-installer
- Sudo apt-get install oracle-java8-set-default
If you want to install Java 7 (I. e Java 1.7), use Java 7 in the preceding command to replace Java 8.
I hope this article will help you learn how to install Java on Ubuntu, Linux Mint, and other Ubuntu-based Linux distributions. We welcome all questions or suggestions.
Install JDK 8 on Ubuntu 14.04
Download, install, and configure Ubuntu 14.04
Ubuntu 14.04 system:
Ubuntu 14.04 text tutorial on hard drive installation in Windows 7