1

I want to install the latest JRE on an Amazon EC2 instance which is based out of the Amazon "Amazon Linux 2 LTS Candidate AMI 2017.12.0 (HVM), SSD Volume Type" AMI.

Ashwin
  • 41
  • 1
  • 5

1 Answers1

2
  1. Download JRE (jre-8u161-linux-x64.rpm) for Linux (64) from http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
  2. SSH into your AMI with the .pem file that you created when Launching hte Instance (ssh ec2-user@AMI_ID -i Path_to_.pem_file.pem
  3. Create a folder called software under /opt (sudo mkdir software).
  4. Change the permissions of the folder (sudo chmod -R 700 .)
  5. Use any sftp client (I used cyberduck on Mac) to login to your instance (Same SSH scredentials, pem file)
  6. Copy your downloaded file into /opt/software
  7. Navigate to the software folder and run (sudo rpm -ivh jre-8u161-linux-x64.rpm).
  8. Check if java is installed by running java -version.
Ashwin
  • 41
  • 1
  • 5
  • Do you consider 777 good advice ? To install a RPM /tmp should be sufficient – Marged Jan 18 '18 at 05:14
  • Changed it to 700, thanks! Yes, /tmp will also do. – Ashwin Jan 19 '18 at 06:32
  • 1
    If OpenJDK is fine (the question did not specify that the proprietary Oracle version is required), you should also be able to just `yum install` it from the normal repositories. – Thilo Jan 19 '18 at 06:37