Install Java in Ubuntu

install java in ubuntu

❖ Introduction

 Java is widely used and required for many kinds of software.This article will guide you through the process of installing and managing different versions of Java.

❖ Install Default JAVA

 The easiest option for install Java is using Terminal.
  • First, Update and Upgrade the package index.
    • $ sudo apt-get update
    • $ sudo apt-get upgrade
  • Next, install Java Runtime Environment (JRE).
    • $ sudo apt-get install default-jre
  • After that, install Java Development Kit (JDK).
    • $ sudo apt-get install default-jdk

 Now, you can check your java is installed or not.
  • $ java --version

❖ Install Oracle Java

 If you want to install the Oracle JDK, which is the official version distributed by Oracle, you will need to follow a few more steps.

  • First, add Oracle's PPA
    • $ sudo add-apt-repository ppa:webupd8team/java
    • $ sudo apt-get update
  • Then, depending  on the version you want to install.
    • For Oracle JDK8
      • $ sudo apt-get install oracle-java8-installer
    • For Oracle JDK9
      • $ sudo apt-get install oracle-java9-installer

 Now, you can check your java Version.
  • $ java --version

❖ Install Oracle Java 11

 If you want to install Oracle JDK 11, you will need to follow this steps.
  • First, add PPA
    • $ sudo add-apt-repository ppa:linuxuprising/java
    • $ sudo apt-get update
  • Then,run commands to install the script to start downloading and installing Java 11 on your Ubuntu.
    • $ sudo apt-get install oracle-java11-installer-local
  • Before getting Started,you must accept the license
    • press TAB to highlight OK and hit Enter/SpaceBar

↪ Now, you can check your jdk11 is installed or not.
  • $ java --version

إرسال تعليق

Post a Comment (0)

أحدث أقدم