+3 votes
329 views
How to install JAVA on Ubuntu 21.10

in Linux / Unix by (550k points)
reopened | 329 views

1 Answer

+4 votes
Best answer

Install Java on Ubuntu 21.10

We have heard of Java and perhaps we relate it to a functionality that allows us to reproduce content and although this is partly true, Java is much more than this, Java allows creating thousands of applications (with those that exist today) being compatible with virtually all modern operating systems..

 

Oracle has developed JDK "Java Development Kit - Java Development Kit" to be a set of tools, documentation and other vital utilities for the development of Java applications, in this way, JDK is integrated by different components such as:

 

JDK components

 

  • A runtime interpreter (JRE)
  • A compiler
  • A debugger
  • An applet viewer

 

 

 

JDK Features
Each of these needs the other to work and that the applications work as they should be. Java is currently in version 16 which offers us features such as:

 

  • Additional Java APIs for Java application development, debugging, and monitoring
  • An API has been introduced to offer access to native code in pure Java and of static type
  • End users are now allowed to select the encapsulation type
  • External memory access API
  • Warnings for value-based classes
  • The default method for compatibility with the default proxy method is InvocationHandler :: invoke
  • Support for Unix domain sockets
  • Day period support added to java.time formats
  • Stream.toList () method was added
  • Improved CompileCommand flag
  • JAR support signed for RSASSA-PSS and EdDSA
  • SUN, SunRsaSign and SunEC providers now support SHA-3 based signature algorithms
  • -Trustcacerts and -keystore options added to keytool -printcert and -printcrl commands
  • SunPKCS11 provider supports SHA-3 related algorithms
  • Encoding of TLS Application Layer Protocol (ALPN) negotiation values ​​has been improved
  • TLS support for EdDSA signature algorithm

 

 

 

Without further ado, let's see how to install the latest version of Java in Ubuntu 21.10.

 

 

To stay up to date, remember to subscribe to our YouTube channel!   SUBSCRIBE

 

Install Java on Ubuntu 21.10

 

Step 1

We open the terminal in Ubuntu 21.10 and we are going to validate that Java is not installed, for this we execute the command:
 java -version 
image

 

 

Step 2

As we can see, Java is not currently installed on the system, for this we will go to the URL of the official Java downloads in the following link:

 

 Java

 

image

 

Step 3

There we click on the line "JDK Download" and then we must download the version of Java JDK for Linux:

 

image

 

Note
We must download the .deb file, clicking on it will open the following pop-up window:

 

image

 

 

Step 4

We activate the box to accept the terms and click on the Download button, we will save this file locally:

 

image

 

Step 5

We wait for the download to finish:

 

image

 

Step 6

Once it is downloaded, we go back to the terminal and there we access the Downloads folder using the cd command and we list the content with "ls" to see the Java JDK download:

 

image

 

Step 7

Now we are going to install Java with the command:
 sudo dpkg -i .deb file 
image

 

 

Step 8

We enter the password to complete the installation:

 

image

 

 

Step 9

At the end we will see that Java has been installed in Ubuntu 21.10:

 

image

 

 

Step 10

After this operation, we are going to execute the following:
 sudo update-alternatives --install / usr / bin / java java /usr/lib/jvm/jdk-16.0.1/bin/java 1 
Step 11

This allows you to update the links to the installed Java version:

 

 

image

 

Step 12

To know the exact version we must execute "ls / usr / lib / jvm":

 

image

 

Step 13

After this we will run. This last command updated what related to javac.
 sudo update-alternatives --install / usr / bin / javac javas /usr/lib/jvm/jdk-16.0.1/bin/javac 1 
image

 

Step 14

We validate the Java version:
 java -version 
image

 

 

Step 15

We validate the version of the Javac compiler:
 javac -version 
image

 

These are the steps to install Java on Ubuntu 21.10 and enjoy its features..

 


by (3.5m points)
edited

Related questions

+3 votes
1 answer
asked Nov 6, 2020 in Linux / Unix by backtothefuture (550k points) | 756 views
+4 votes
1 answer
asked Mar 19, 2020 in Linux / Unix by backtothefuture (550k points) | 939 views
+5 votes
1 answer
asked May 8, 2021 in Linux / Unix by backtothefuture (550k points) | 312 views
+5 votes
1 answer
asked May 6, 2021 in Linux / Unix by backtothefuture (550k points) | 308 views
+4 votes
1 answer
asked May 6, 2021 in Linux / Unix by backtothefuture (550k points) | 378 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,627 questions
10,759 answers
510 comments
3 users