简体   繁体   中英

How do I install JDK 15 on my AWS Linux Ec2 instance?

I need to install jdk 15 on my Amazon ami linux instance of EC2. I can't seem to find it using the command sudo yum list available | grep javasudo yum list available | grep java Any answers would be appreciated!

OpenJDK Java 15 is not available for Linux AMI, and I don't imagine it will be.

According to https://aws.amazon.com/amazon-linux-ami/ . AMI has entered the maintenance support phase of its end-of-life. That means:

"During this maintenance support period:

  • The Amazon Linux AMI will only receive critical and important security updates for a reduced set of packages.
  • It will no longer be guaranteed to support new EC2 platform capabilities, or new AWS features."

Doing new stuff (ie involving Java 15) on AMI is a bad idea.


The replacement for AMI is Amazon Linux 2 . I can't find a browsable list of packages, so I can't tell you whether Java is available for it. (But I doubt it.)


When I search for AWS Java 15, I find a link to the Amazon Corretto: Corretto 15 User Guide . This has installation instructions for a number of OSes, and the relevant ones for AMI and Amazon Linux 2 are as follows:

To use Corretto RPM repositories with the yum package manager, import the Corretto public key and then add the repository to the system list. For most systems, you must run the following commands:

 sudo rpm --import https://yum.corretto.aws/corretto.key sudo curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo

After the repository is added, you can install Corretto 15 by running this command:

 sudo yum install -y java-15-amazon-corretto-devel

It is worth noting that many other vendors provide Java (many version) for generic Linux. One would expect that they could be installed on an AWS AMI instance. You would just need to follow the relevant instructions.

I would try to install AdoptOpenJDK by following their instructions .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM