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.
Asked
Active
Viewed 7,543 times
1 Answers
2
- Download JRE (jre-8u161-linux-x64.rpm) for Linux (64) from http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
- 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
- Create a folder called software under /opt (sudo mkdir software).
- Change the permissions of the folder (sudo chmod -R 700 .)
- Use any sftp client (I used cyberduck on Mac) to login to your instance (Same SSH scredentials, pem file)
- Copy your downloaded file into /opt/software
- Navigate to the software folder and run (sudo rpm -ivh jre-8u161-linux-x64.rpm).
- 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
-
1If 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