SSD Grow


Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Learn How to Install Java and Its virtual Machine on Ubuntu 22.04


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Table of Content


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Java is a widely-used, high-level, object-oriented programming language that has become an industry standard. The Java Virtual Machine (JVM) is a vital component that allows computers to execute Java applications, as well as programs that can be compiled to Java bytecode, such as Kotlin and Scala. The use of Java and the JVM is fundamental to many DevOps tools, including popular applications such as Apache Tomcat, Cassandra, and Jenkins. In this tutorial, we will delve deeper into the significance of Java and the JVM in the context of DevOps, and examine how they are applied in widely-used software tools.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Before starting, you should have a basic understanding of the Linux command line. Additionally, you will need an Ubuntu 22.04 server, and a non-root user with sudo privileges. You can obtain affordable and powerful Ubuntu servers from our website. To learn how to access your server and create a sudo user, you can refer to our guide on How to access your server using SSH.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Updating Package Cache: Keeping Your System Up-to-Date


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Start by updating the packages in the package manager cache to the latest available versions using the following command:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo apt update


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Installing the JRE/JDK using Apt


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
To install the JRE from the OpenJDK version of Java, use the following command:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo apt install default-jre


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
This will install the default JRE in the Ubuntu repositories, and will allow you to execute Java programs.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Once the installation is finished, check your Java version to ensure that the JRE was successfully installed:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

java -version


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
You should receive an output similar to the following:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu222.04, mixed mode, sharing)


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Next, install the JDK to compile and run some Java software that requires it. To do so, use the following command:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo apt install default-jdk


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
To ensure that the JDK is successfully installed, check the version of the Java compiler javac:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

javac -version


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
You should receive an output similar to the following:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

javac 11.0.17


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
With this, you now have Java installed on your system with OpenJDK. If you are looking to install the Official Oracle JDK, follow the next option.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Installing Oracle JDK


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
If you want to install and use OracleJDK, and not OpenJDK, or switch between the two depending on your requirements, use the following instructions.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
First, install some required packages:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo apt install -y libc6-x32 libc6-i386


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Go to the Oracle downloads page and download the x64 Debian Package version using wget:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

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


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

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


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Once your .deb package is downloaded, install it using apt:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo apt install ./jdk-19_linux-x64_bin.deb


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Once installed, use the following commands to set these new packages for update-alternatives:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-19/bin/java 100
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-19/bin/javac 100


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Manage Java


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
If you’ve installed one or more Java versions, then you can use the update-alternatives command to set the default version for your system.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
To select your default Java installation, run the following command:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo update-alternatives --config java


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
You’ll receive a list of the Java versions you currently have installed on your system:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
2 /usr/lib/jvm/jdk-19/bin/java 100 manual mode

Press to keep the current choice[*], or type selection number:


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Press Enter to leave the current option, or type the number of the Java version you want to set.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
For example, type in 2 and press Enter to set the OracleJDK version.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
You can also use update-alternatives to configure the default version of your Java compiler:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo update-alternatives --config javac


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
You should receive an output similar to the following:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

There are 2 choices for the alternative javac (providing /usr/bin/javac).

Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1111 manual mode
2 /usr/lib/jvm/jdk-19/bin/javac 100 manual mode


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Again, choose 2 to use the OracleJDK compiler as your default compiler and press Enter.


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
To verify that Java was installed, check out its version:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

java -version


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
You should receive an output similar to the following:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

java version "19.0.1" 2022-10-18
Java(TM) SE Runtime Environment (build 19.0.1+10-21)
Java HotSpot(TM) 64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
To verify that the Java compiler was installed, check out its version:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

javac -version


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
You should receive an output similar to the following:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

javac 19.0.1


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Configuring the Java Home Directory Environment Variable


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Now that you’ve installed Java on your Ubuntu server, you need to to set up the $JAVA_HOME environment variable, which is a variable used by many Java packages and software programs written in Java to determine where Java is installed.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
First run the update-alternatives to get the path of your current Java installation:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo update-alternatives --config java


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
This will list paths of your different Java installations, which will be similar to the following:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
2 /usr/lib/jvm/jdk-19/bin/java 100 manual mode


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Here, OpenJDK is located at /usr/lib/jvm/java-11-openjdk-amd64/bin/java and OracleJDK is located at /usr/lib/jvm/jdk-19/bin/java.

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Choose and copy a path depending on your requirements, then open the /etc/environment file:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

sudo nano /etc/environment


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87
Add your path at the end of this file and assign it to a variable called JAVA_HOME, excluding the /bin/java portion, like so:

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Save and close /etc/environment.


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Reload /ect/environment:


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

source /etc/environment


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Now check out the value of your Java Home variable:


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

echo $JAVA_HOME


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

This should print the path you’ve set:


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

/usr/lib/jvm/java-11-openjdk-amd64


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

You have learned how to install Java on your Ubuntu system using two different methods. The first method involves installing the OpenJDK version available in your Ubuntu repositories, while the second method involves installing the official OracleJDK. Additionally, you have become proficient in installing and switching between both versions effortlessly, making it easier to meet your changing needs.


Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Category


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Share


Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Related Articles


Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87

Warning: Undefined array key "_border_border" in /www/wwwroot/ssdgrow.com/wp-content/plugins/elementor/includes/conditions.php on line 87