Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 8 application on EC2

I was wondering if anyone knows if it will be possible for me to install Java 8 on an EC2 instance. My application is packed as a fat jar with embedded jetty, so the Java 8 runtime alone should be sufficient.

I'm not too familiar with Linux, and I saw that they only had Java 7 support on the default AMI. Is there a simple command I can run to update to Java 8?

like image 245
Rune Aamodt Avatar asked Jul 05 '14 17:07

Rune Aamodt


People also ask

Does EC2 have Java installed?

By default, the EC2 instance does not have Java installed. You can check it using the command in the EC2 console. Now, create a sub-directory named jvm inside /usr/lib/jvm. You can access this folder by accessing the basic file system using cd ..

How do I install Java 11 on AWS EC2?

Follow the steps below to install Java JDK11 on AWS EC2: Step 1: Create an AWS Elastic Cloud Compute Instance. Step 2: Start the EC2 instance that you have created in Step 1. Step 3: Connect to your EC2 Instance by clicking on Connect Button.


2 Answers

check Java current version

java -version 

install Java 1.8

sudo yum install java-1.8.0 

change the Java version

sudo alternatives --config java 
like image 106
Damith Ganegoda Avatar answered Sep 18 '22 14:09

Damith Ganegoda


Java 8 may not be available out-of-the-box on the AMI that you are looking for. However, you can always install it once the instance is created.

e.g. Check this post which explains how to install java 8 on Ubuntu OR check this post which explains how to install Java 8 on RHEL/Fedora/CentOS.

like image 41
slayedbylucifer Avatar answered Sep 20 '22 14:09

slayedbylucifer