The Program Java Can Be Found in the Following Packages

Java is a general-purpose, class-based, object-oriented multipurpose programming language that is pop due to the design of having lesser implementation dependencies, meaning that the compiled Java lawmaking can be run on all platforms that support Java without the need for recompilation. Java is also fast, secure, and reliable, therefore. It is widely used for developing Java applications in laptops, information centers, game consoles, scientific supercomputers, prison cell phones, etc.

JDK 17 (JDK 17) has brought forward new language enhancements, updates to the libraries, support for new Apple computers, removals and deprecations of legacy features, and piece of work to ensure Java lawmaking written today will keep working without change in hereafter JDK versions.

In the following tutorial, you will learnhow to install the latest Coffee 17 (JDK 17) on Ubuntu twenty.04 LTS Focal Fossa.

For users wishing to install the OpenJDK 17 version, please see the tutorial How to Install OpenJDK 17 on Ubuntu 20.04.

Prerequisites

  • Recommended OS: Ubuntu 20.04.
  • User account:A user business relationship withsudo or root access.

Update Operating System

Update yourUbuntu operating organisation to make certain all existing packages are up to date:

          sudo apt update && sudo apt upgrade -y        

The tutorial will be using the sudo control andbold yous accept sudo status.

To verify sudo status on your account:

          sudo whoami        

Example output showing sudo status:

          [joshua@ubuntu ~]$ sudo whoami root        

To set an existing or new sudo account, visit our tutorial onHow to Add a User to Sudoers on Ubuntu.

To use theroot account, use the post-obit command with the root password to log in.

          su        

The tutorial will apply the terminal interface, which tin exist establish in thetestify applications menu.

Example:

How to Install Oracle Java 17 LTS (JDK 17) on Ubuntu 20.04

Install Java JDK 17 – APT PPA Method

The first pick will exist to install Java 17 JDK from the ppa:linuxuprisingrepository. Currently, Java 17 is featured in this PPA. This is a not-official repository, equally ever with any PPA use with circumspection and at your own risk.

First, import the PPA using the post-obit command in your terminal:

          sudo add-apt-repository ppa:linuxuprising/coffee -y        

Next, update your APT repository.

          sudo apt update        

To install using the APT package manager, execute the post-obit command:

          sudo apt-get install oracle-java17-installer oracle-java17-set-default        

Example output:

How to Install Oracle Java 17 LTS (JDK 17) on Ubuntu 20.04

Note that yous volition need to have Oracle'south terms during the installation.

Verify the installation was successful using the –version command:

          java 17 2021-09-14 LTS Coffee(TM) SE Runtime Surroundings (build 17+35-LTS-2724) Java HotSpot(TM) 64-Flake Server VM (build 17+35-LTS-2724, mixed mode, sharing)        

To remove Java 17 JDK using the apt package manager method, run the following command:

          sudo apt autoremove oracle-java17-installer oracle-java17-set-default --purge        

Case output:

How to Install Oracle Java 17 LTS (JDK 17) on Ubuntu 20.04

Blazon Y, then press ENTER KEY to go along with the uninstall.

Install Java JDK 17 – DPKG Method

Install Dependency Packages

To successfully install JDK 17, you need to install the following packages.

          sudo apt install libc6-i386 libc6-x32 whorl -y        

Install Java 17 DPKG Method

The easier choice just the most restrictive is to install Coffee JDK 17 using thedpkg command, which is a tool to install, build, remove and manage .deb packages.

Get-go, download the .deb parcel from Coffee's download page, or copy and paste the link into a wget command in your concluding.

Example:

          wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.deb        

Note this link should piece of work if information technology doesn't go to the website to get a new 1.

Once you take downloaded the .deb package, run the following command in your terminal to install Java:

          sudo dpkg -i jdk-17_linux-x64_bin.deb        

Instance output:

How to Install Oracle Java 17 LTS (JDK 17) on Ubuntu 20.04

Remove Coffee 17 DPKG Method

If you no longer require Java JDK 17 and have installed the software using the .deb JDK package, you tin can use the post-obit dpkg command with the -r flag option that will remove the package as the example beneath:

          sudo dpkg -r jdk-17        

Example output:

How to Install Oracle Java 17 LTS (JDK 17) on Ubuntu 20.04

Install Coffee JDK 17 – Manual Method

The second and about recommended option is to install Java JDK 17, the manual manner that benefits users more freedom and power on what they desire and where installed on their system.

Install Dependency Packages

To successfully install Java JDK 17, you need to install the following packages.

          sudo apt install libc6-i386 libc6-x32 gyre -y        

Download Latest Java 17 Build

Visit the downloads folio to go the latest build version link, then use the followingcurl command:

          roll  -O https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz        

In one case the download is consummate, you need to extract the archive as follows:

          tar -xvf jdk-17_linux-x64_bin.tar.gz        

Configure and Install Java 17

Next, move the extracted archive directory into the/opt/ location:

          sudo mv jdk-17.{version} /opt/jdk17        

Note, y'all need to add the version number, such as jdk-17.02 in {version} with the above command.

At present you need to ready the environment variables as below:

          export JAVA_HOME=/opt/jdk17 export PATH=$PATH:$JAVA_HOME/bin        

Java 17 is now installed. To ostend, use the post-obit commands:

          java --version echo $JAVA_HOME        

If installed correctly, you should come across the following output:

          java 17 2021-09-xiv LTS Java(TM) SE Runtime Surroundings (build 17+35-LTS-2724) Coffee HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed way, sharing) /opt/jdk17        

As you can see, you tin see the version is the latestJava 17 JDK build.

Test Java – Create Hello World Application

To finish off, information technology is always handy to examination installations of these kinds to ostend everything is working correctly later on beingness installed. The like shooting fish in a barrel fashion is to create a small program script to test using the famous Hello World.

Get-go, create the Java program file as follows

          sudo nano hullo.coffee        

Adjacent, add the post-obit Java code into the file:

          public class hello {   public static void main(String[] args) {     System.out.println("G'24-hour interval from LinuxCapable!");   } }        

Salvage the file(CTRL+O), then get out(CTRL+X).

Adjacent, compile the code:

          javac hello.coffee        

Finally, run the Java lawmaking with the following command:

          java hello        

Example output:

How to Install Oracle Java 17 LTS (JDK 17) on Ubuntu 20.04

Congratulations, everything is working correctly.

In the tutorial, you have learned how to download and install the latest version of Java 17 (JDK 17) on Ubuntu twenty.04 LTS Focal Fossa Desktop or Server. Overall, for developers to upgrade Java can be a painstaking task, merely in the long term, upgrading to Java 17 will be worth the goal of being an LTS version support will be around forth with improvements for quite some time.

maroneyweirche.blogspot.com

Source: https://www.linuxcapable.com/how-to-install-java-17-lts-jdk-17-on-ubuntu-20-04/

0 Response to "The Program Java Can Be Found in the Following Packages"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel