I'm new to Spring Boot and I'm trying to develop an application to later deploy it on AWS beanstalk. I started the project using java 11 but later I discovered that AWS only support java 8. Is it possible to set 'maven.compiler.target' in pom.xml to 1.8 to make it running correctly? Should I have to use Java 1.8 for both development and compile? I would like to use new Java features and library. I would like to have some opinion if someone have same problems. Thanks. Cd
Spring Boot 2.7. 1 (and therefore the latest Spring Framework 5.3. 22) supports Java 17 while also remaining compatible with Java 11 and 8.
On July 18, 2022 Elastic Beanstalk set the status of all platform branches based on Amazon Linux AMI (AL1) to retired. For more information, see AL1 platform retirement FAQ in the AWS Elastic Beanstalk Developer Guide.
Amazon Web Services offers multiple ways to install Spring Boot-based applications, either as traditional web applications (war) or as executable jar files with an embedded web server. The options include: AWS Elastic Beanstalk. AWS Code Deploy.
You can install java 11 on your instances using ebextensions. Just create a folder .ebextensions in your source bundle and add there one file with following name 10_java.config and content:
[UPDATE: fixed formatting of the yaml file]
container_commands:
100-remove-old-java:
command: "sudo yum remove -y java-1.8.0-openjdk-headless"
200-download-rpm-package:
command: "wget https://d3pxv6yz143wms.cloudfront.net/11.0.4.11.1/java-11-amazon-corretto-devel-11.0.4.11-1.x86_64.rpm "
300-install-java:
command: "sudo yum localinstall -y java-11-amazon-corretto-devel-11.0.4.11-1.x86_64.rpm"
This will remove default java 8 and install AWS' distribution of java 11.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With