How to install JDK 10 in Ubuntu 18.04?

In this tutorial you will learn How to install JDK 10 in Ubuntu 18.04?

How to install JDK 10 in Ubuntu 18.04?

Java/JDK 10: How to install JDK 10 in Ubuntu 18.04?

Java/JDK 10 is already here with many new features and updates. The most important changes is the support of var for declaration of location type variable. This feature is known as Local Variable Type inference and it is one of the most exciting feature of this release.

The Ubuntu 18.04 is latest release of Ubuntu operation system in 2018 and developers are using this operating system for development/deployment of enterprise applications. The apt tool is handy tool for installing software on Ubuntu operating system.

Java/JDK 10 release binary is available on the Ubuntu PPA update site and it can be installed with the help of this tool.

In this tutorial we are going to add the PPA repository details on the Ubuntu 18.04 operating system and then install JDK 10 on it. I have already installed one machine on the Oracle virtual VM and on this I will install Oracle Java 10.

Here are the steps of install JDK 10 on Ubuntu 18.04

Step 1: Install using the Personal Package Archives (PPA).

First off run the following command on terminal:

$ sudo add-apt-repository ppa:linuxuprising/java

Step 2: Update system

Then update your system with following command:

$ sudo apt-get update

Step 3: Install Oracle Java 10

Now start Java 10 installation process

$ sudo apt-get install oracle-java10-installer

Video Instruction of Installing JDK/Java 10 on Ubuntu 18.04:

Step 4: Set Java/JDK 10 as default

Set Java 10 as defaults with the following command:

$ sudo apt-get install oracle-java10-set-default

Now you should verify the installation:

java --version

javac --version 

Output should look like:

[email protected]:~$ java --version
java 10.0.1 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
[email protected]:~$ javac --version
javac 10.0.1
[email protected]:~$ 

Above command will display the Java/JDK version as 10.x. So In this tutorial you learned to install JDK 10 on Ubuntu 18.04.

Here are more tutorials of Java:

Tutorials

  1. Aware Yourself About the Reasons and Benefits of Learning Python
  2. How to get today's date in java in mm/dd/yyyy format?
  3. Java 17 Features
  4. Upcoming features of Java 17
  5. Java/JDK 17 tutorials
  6. JDK 16 Features
  7. Why You Should Learn Java in 2021?
  8. Java/JDK 15 upcoming new features
  9. JDK/Java 15 Tutorials
  10. How to install OpenJDK 8 in Ubuntu 18.04?
  11. Java Interpreter is used for which purpose?
  12. Java program to read a text file and write to another file
  13. How to Serialize and Deserialize Array List in Java?
  14. What are the prerequisites for learning Java?
  15. How to convert a stack trace to a string?
  16. Example code of reading file line by line in Java with Apache Commons IO library
  17. How to store unique values in Java using Set?
  18. java.nio ShortBuffer Example
  19. How to use Java Path class?
  20. Java NIO Package Tutorial
  21. How to limit object creation in Java?
  22. Java 11 String lines function example to split it in lines
  23. Top upcoming features of JDK 11
  24. Java/JDK 11 Tutorial
  25. How to install JDK 10 in Ubuntu 18.04?
  26. Install JDK 10 on Windows
  27. Java 10 features
  28. Processing large file in Java
  29. Learning Java for non programmers
  30. Why You Should Learn Java in 2018?
  31. Installing JDK 9 on Windows 10
  32. How to convert binary to decimal in Java?
  33. How to add two numbers in Java?
  34. What is Applet in Java with Example?
  35. What is nested class in Java with Example?
  36. Exception handling in Java Programming Examples
  37. What is Constructor Overloading in Java?
  38. How to display image in Swing?
  39. What is Java programming used for?
  40. How to create custom exception in Java?