×
☰ See All Chapters

How to install Java on AWS EC2 virtual machine from PuTTY

Once you have connected to virtual machine through PuTTY it is easy to install additional software with the help of the package manager apt. First, we need to make sure the package manager is up-to-date. Please run the following command to update the list of available packages:

apt-get update

installing-java-to-ec2-virtual-machine-0
 

Step 1: Check if Java installed

Run the command java -version

If already Java installed you will see the java installed version. If not installed the you would see the message as below:

installing-java-to-ec2-virtual-machine-1
 

Step 2: Install Java

Run the command sudo apt install default-jre to install JRE.

installing-java-to-ec2-virtual-machine-2
 

Enter Y and press Enter from keyboard. Once after installation is completed, you run the command java -version again, you should see the installed java version.

installing-java-to-ec2-virtual-machine-3
 

All Chapters
Author