Connect with us

Linux

How to Install and Configure Java on Ubuntu 20.04

Published

on

How to Install and Configure Java on Ubuntu 20.04

Java is one of the most popular programming languages ​​used to build various types of applications and systems. Java runs on all operating systems and devices. We can find applications developed in Java on your laptop, mobile phone, and game console.

In this guide, we will learn how to install Java on Ubuntu 20.04.

Before starting

There are several different Java implementations. OpenJDK and Oracle Java are the two main implementations of Java, with almost no difference between them except that Oracle Java has some additional commercial features. The Oracle Java license only permits non-commercial use of the software, such as personal use and development use.

The default Ubuntu 20.04 repository includes two OpenJDK packages, the Java Runtime Environment (JRE) and the Java Development Kit (JDK). The JRE consists of the Java virtual machine (JVM), classes, and binaries that make it possible to run Java programs. The JDK includes the JRE and the development/debugging tools and libraries needed to build Java applications.

If you are not sure which Java package to install, the general recommendation is to install the default version of Java, which is the OpenJDK version (JDK 11). Some Java-based applications may require a specific Java version, so as a user, it is mandatory to read the application documentation.

Install Java OpenJDK 11 on Ubuntu 20.04

At the time of writing, Java 11 is a long-term supported (LTS) version of Java. It is also the default Java development and runtime in Ubuntu 20.04.

Run the following command as a user with Sudo or root privileges to update the packages index and install the OpenJDK 11 packages:

sudo apt update
sudo apt install openjdk-11-jdk

The JRE is included in the JDK package. If you only need the JRE, install the OpenJDK-11-JRE. For minimal Java runtime, install the OpenJDK-11-JDK-headless.

Once the installation is complete, verify by checking the Java version:

java -version

The output will look like this:

openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)

At this point, the Java installation on the Ubuntu system has been successful.

Install Java OpenJDK 8 on Ubuntu 20.04

Java 8, the earlier LTS version of Java, is still widely used. If your application is running on Java 8, you can install it by typing the following command:

sudo apt update
sudo apt install openjdk-8-jdk

Verify the installation by checking the Java version:

java -version

The output will look like this:

openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1ubuntu1-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Set Default Java Version on Ubuntu 20.04


If you have multiple versions of Java installed on the system, To check the default Java version, you can use the following command:

java- Version

To be able to change the standard version, use the tools update-alternatives as shown below:

sudo update-alternatives --config java

The output will look like the following

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/java-8-openjdk-amd64/jre/bin/java 1081 manual mode

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

You will be presented with a list of all installed Java versions. Enter the version number you want to use as the default and press Enter.

Set JAVA_HOME Environment Variable

Some applications written in Java use environment variables JAVA_HOMEto specifies the Java installation location.

To set the JAVA_HOME environment variable, use the command update-alternatives to find where Java is installed:

sudo update-alternatives --config java

In our case, the installation path is as follows:

  • OpenJDK 11 is located at /usr/lib/jvm/java-11-openjdk-amd64/bin/java
  • OpenJDK 8 is located at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

Copy the installation path of the installation of your choice. Next, open the file /etc/environment :

sudo nano /etc/environment

Add the following line, at the end of the file:

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

Make sure to replace the path with the path to your Java version of choice.

You can log out and then log back in, or run the following source command to apply the changes to the current session:

sources /etc/environment

To verify that the environment variables are JAVA_HOMEset correctly, run the following echo command:

echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64

/etc/environment is the system configuration file, which is used by all users. If you want to set variables JAVA_HOMEon on a per user basis, add a line to .bashrcor other configuration file that is loaded when the user logs in.

How to Uninstall Java on Ubuntu 20.04

If for some reason you want to uninstall a Java package, you can uninstall it like any other package installed with apt.

For example, if you want to remove a package default-JDK just run the command:

sudo apt remove openjdk-11-jdk

Conclusion

OpenJDK 11 and OpenJDK 8 are available in the default Ubuntu 20.04 repositories and can be installed using the apt package manager.

Advertisement

Linux

How to repair a corrupted or unreadable USB stick using Ubuntu and Gparted?

Published

on

How to repair a corrupted or unreadable USB stick using Ubuntu and Gparted

A free software system like Ubuntu has many advantages over its closed source competitors because it allows all kinds of actions to be carried out with commands. One of them even allows you to fix faulty devices, so with that in mind today you will learn how to repair a damaged or unreadable USB memory using Ubuntu and Gparted.

If you have seen the title and thought that it is crazy to repair a USB directly from an operating system, then you have probably never used Linux because it is open-source, it gives certain facilities to its users so that they can edit things that allow them to create new tools from scratch.

Repair a corrupted or unreadable USB stick using Ubuntu and Gparted

To get straight to the point and start the process that will help you repair a damaged or unreadable USB memory using Ubuntu and Gparted, you obviously have to install Gparted on your PC if you haven’t downloaded it yet.

You will achieve this by opening your command window in the menu and entering the following: Sudo apt-get install GParted, this action will immediately install the program, once the process finishes you will be able to use it without any limitation.

Now to begin the USB repair process, you must put this USB into one of the ports that you have available (make sure it is working perfectly since you cannot disconnect the memory until the process is finished).

How to repair a corrupted or unreadable USB stick using Ubuntu and Gparted

Once it is connected, the Gparted will recognize it immediately, so the next step will be to open the program, then you will have to stand over the button that has the same name as the application (it is in the menu above), and click on ” Refresh devices ”, so that the USB appears that way.

Format or resize

When your memory has been loaded into the program, you will notice that the amount of GB it has appeared, and also a small section where there are a few MB (that is the firmware information), in case that information does not come out. , then you will not be able to repair the USB (usually happens with 8 or 128 GB memory).

If you get it, then proceed to click on the option with more memory, which will show several elements in a list, select “Delete” to format it, and if it doesn’t let you do that, then click on “Resize/Move”.

That will let you partition the device so that you can shrink the USB to the space that is considered real. If your memory is 64 then create a partition of 8, if it is 32 make it 4 (if it is some other then you can search the web for what the value would be).

How to repair a corrupted or unreadable USB stick using Ubuntu and Gparted

In order to create this partition, you only have to lower the amount of memory in the “New size” field with the bar that appears in the “Resize” section. When finished, just press “Resize/Move” to confirm and that’s it. If you want, you can try to repair the memory card without formatting, it may be a process, but maybe you will succeed.

Where to direct memory

With the above, you are just a few steps away from finishing the process that will help you answer the question How to repair a damaged or unreadable USB memory using Ubuntu and Gparted? , the next thing you should do is direct the memory where you want.

For that, click again on the section of your USB, but this time press the option “Format to”, there you will get a list of places that you can select, the recommended thing is to press “FAT32” if the destination of the USB is mobile and “NFTS” if you use it on a computer.

Having chosen one, the process will be complete and it is most likely that the USB can already be used, so the question How to repair a damaged or unreadable USB memory using Ubuntu and Gparted? , has finally been answered.

But before finishing, I tell you that if you want to force format the USB, you could also try it. And, if you finally can’t fix it, you can try to recover RAW formatted USB files.

Continue Reading

Linux

How to install Linux Ubuntu operating system from USB on my PC – Steps and requirements

Published

on

How to install Linux Ubuntu operating system from USB on my PC - Steps and requirements

Linux Ubuntu is characterized by being a light and simple system, highly recommended to take advantage of older PCs, this operating system has a wide variety of useful tools when it comes to working, playing, or entertaining.

Due to its low weight and a great repertoire of tools, it is one of the most famous Linux distributions, having a large number of users, is classified among the best, together with Fedora, Linux mint, it is also compared many times with Xubuntu, a version of Linux that consumes very little resources.

How to boot a USB with Linux Ubuntu?

Booting a USB memory is the process prior to the installation of an operating system since in this the respective programs are installed that will know how to identify the PC’s BIOS during the installation process, to boot a USB, we have several options.

If we start from a Linux system, a good alternative is to use Unetbootin, which is a multiplatform tool that has the objective of booting USB, having the ability to have the ISO images of different systems at the same time.

After installing the program and executing it, a gray window will appear, in the lower right a button will appear with 3 dots “…”, we will click and it will ask us to select an ISO image, we mark the Ubuntu Linux image and proceed to choose our USB memory and accept. If we have problems locating the file, we can search for them from the Terminal, with the “Locate and Find” commands.

How to install Linux Ubuntu operating system from USB on my PC - Steps and requirements

If we are on Windows, whatever the version, we will use “Rufus”, a USB memory boot program, it also has a simple menu, in which we select the corresponding ISO, then the destination (our USB) and finally we accept.

How to install Ubuntu from Windows?

If we are on Windows and we want to switch to Ubuntu, or just add it as a secondary system, we must first create a USB memory with the system, there are many versions of Linux Ubuntu, and it will vary which is the best for you, depending on your needs.

Once the file is created on the USB, we must turn off our computer, it is important to know what brand is our motherboard or what brand is our laptop, this, in order to know which key opens the boot menu, usually it is “F8” or “F11“, we turn on our equipment, and press the start key several times, a menu should appear, normally it is blue, in which we will select the one with the name of our USB memory.

When we do this we will get another menu with several options, we must mark the one that says “Ubuntu”, and it will start the installation, it will ask us to select the language of our preference, we will also have to choose the layout of our keyboard, after this, it will ask us To know what type of installation we want, we must give “normal or complete installation”.

If we want to keep our Windows system we will have to mark “install together with Windows”, and we will be asked to know how much space we want to allocate to the application, it is important to know that Ubuntu offers great freedom to make modifications to the system, for this reason, it is important to know some of the most important commands of the system to handle it more easily.

How to install Ubuntu from another version of Linux?

If we already have another Linux distribution on our computer and we want to change it to Ubuntu, or we simply have an old version and we want to update, the process is similar to what we would do if we were on Windows.

How to install Linux Ubuntu operating system from USB on my PC - Steps and requirements

When we are going to carry out this process, many people have the question of whether it is necessary to update the BIOS and how to do it, but in reality, this is not necessary, since Ubuntu can work in low-resource systems easily. Once we have our USB booted with Unetbootin, we will proceed to restart our computer and press the key to open the boot menu, once opened.

We select the USB drive that the system has and we open it with entering, the installer will open and we choose the language, keyboard, and time zone that correspond to us, we can choose between eliminating any other version of Linux or installing it in parallel, After this the program will finish the installation automatically, leaving you on the desktop, ready for use.

Continue Reading

Linux

How to Download and Install AIMP Player on Ubuntu Linux Easily

Published

on

How to Download and Install AIMP Player on Ubuntu Linux Easily

If you are a lover of the Aimp application for listening to music then read this tutorial where you will learn how to download and install AIMP player on Ubuntu Linux easily. In turn, we recommend Cantata, a useful program to listen to the radio in Linux.

How to Download and Install AIMP Player on Ubuntu Linux Easily

Natively the Aimp application is not available for Linux, even so, there are ways with which we can use the program. Either way, to use these methods, a series of steps must be followed.

Configure WINE

It is very important that you keep in mind that for this process we will use WINE since Aimp is not available for Linux. For this reason, it is essential that you know how to configure WINE correctly on Linux.

How to Download and Install AIMP Player on Ubuntu Linux-Easily

The aforementioned process is very important since the Aimp music program will run through the WINE software. The truth, in most cases, the latest versions of Linux, already have Wine configured. In any case, if you have trouble installing apps, follow the advice mentioned above.

Download the Aimp application

The first thing to do is download the Aimp application, for this, it is necessary to go to its official website. Once you are there, it will be necessary to select the version for Windows, so press the newest one that appears.

After clicking on Aimp download, different ways to download the application will be shown. We recommend downloading it directly from the link to the official page, that is, select “Aimp”. After this process, wait for the application to download, which should not take more than a few minutes.

Install the Aimp application

Double-click on the previously downloaded file, after which the installation should begin as normal. The screen will display the notice for selecting the language, select Spanish and click on “OK”.

After the previous step, the Aimp installation wizard will be displayed, now you just have to click on “Next”. Accept the terms and conditions displayed on the screen and proceed with the installation. Here there are two ways to install the program, one of them is the portable version, and the other is the normal one.

How to Download and Install AIMP Player on Ubuntu Linux-Easily

The portable version of Aimp can be run from anywhere you choose, even from a Pendrive. While the normal version installs the program like any other Windows (in this case WINE). Choose the version that suits you best and continue with the installation.

Once the installation is complete, you can use the program to listen to music on your computer. It should be noted that even though WINE performs excellently, there may be some compatibility issues. Given this, it would not hurt to consider an alternative to this fabulous program.

Audacious, the alternative to Aimp on Linux

One of the first options that come to mind when we think of alternatives to Aimp, is Audacious. Audacious is an open-source music listening application that has all the options you may require. Without a doubt, it is a program for music lovers.

The application is developed specifically for Linux, so you can download it without any problem or compatibility failure. To access the download area for the app, head over to the Audacious website. Once there, download the appropriate version for Linux and proceed with the installation.

Please note that the program is also available for the Microsoft operating system (Windows). For this reason, if you have a Windows computer, you can also enjoy this great software that undoubtedly competes with Aimp.

Continue Reading
Advertisement

Latest

How to find out who has seen my TikTok profile - Android or iPhone How to find out who has seen my TikTok profile - Android or iPhone
TikTok1 day ago

How to find out who has seen my TikTok profile – Android or iPhone

SHARE Without a doubt, the social platform TikTok since its launch has generated great power in the networks, counting thousands...

How to Remove Internet Trace and Why Do It - Definitive Guide How to Remove Internet Trace and Why Do It - Definitive Guide
How-To1 day ago

How to Remove Internet Trace and Why Do It – Definitive Guide

SHARE Every time you surf the internet on any page you access, a fingerprint or path is created that can...

Twitter Users on iOS Can Now Directly Share Tweets to Instagram Stories Twitter Users on iOS Can Now Directly Share Tweets to Instagram Stories
Social Media1 day ago

Twitter Users on iOS Can Now Directly Share Tweets to Instagram Stories

SHARE Most of your Instagram users must have seen a Stories that displays screenshots of tweets taken from Twitter. Indeed,...

Apple has reportedly 'turned off' production of the iPhone 12 Mini, why Apple has reportedly 'turned off' production of the iPhone 12 Mini, why
News1 day ago

Apple has reportedly ‘turned off’ production of the iPhone 12 Mini, why?

SHARE When the iPhone 12 Series was first launched, many people were quite surprised to see the iPhone 12 Mini...

How to make graphs in Excel with various data easily How to make graphs in Excel with various data easily
Excel4 days ago

How to make graphs in Excel with various data easily

SHARE Everyone at some point in our lives has seen the need to make some kind of graph, but we...

NASA's Perseverance Rover is now actively looking for signs of life on Mars NASA's Perseverance Rover is now actively looking for signs of life on Mars
Science4 days ago

NASA’s Perseverance Rover is now actively looking for signs of life on Mars

SHARE After successfully landing on Mars some time ago, now NASA’s Perseverance rover is ready to look for signs of...

Samsung Called to Recruit Engineers from Apple and AMD to Design New CPUs Samsung Called to Recruit Engineers from Apple and AMD to Design New CPUs
News4 days ago

Samsung Called to Recruit Engineers from Apple and AMD to Design New CPUs

SHARE Recently there were reports that Samsung was planning to hire former engineers from Apple and AMD who had worked...

Starting June 28, Free Google Meet Group Calls Will Be Limited To 1 Hour Only Starting June 28, Free Google Meet Group Calls Will Be Limited To 1 Hour Only
News6 days ago

Starting June 28, Free Google Meet Group Calls Will Be Limited To 1 Hour Only

SHARE It doesn’t matter if someone works from home or studies from home because many people from home must be...

AI Technology from Facebook Can Track Where Deepfake Videos Come From AI Technology from Facebook Can Track Where Deepfake Videos Come From
Social Media6 days ago

AI Technology from Facebook Can Track Where Deepfake Videos Come From

SHARE Currently, the development of Artificial Intelligence or AI technology is indeed very rapid. Now AI can be used to...

TikTok Drafts - How to Create, Edit or Delete Them - Simple Guide TikTok Drafts - How to Create, Edit or Delete Them - Simple Guide
TikTok7 days ago

TikTok Drafts – How to Create, Edit or Delete Them – Simple Guide

SHARE In this article, we will talk about TikTok Drafts, also seeing how we can make one, delete them, recover...

Advertisement

Categories

Trending

Copy link
Powered by Social Snap