Skip to content

Instantly share code, notes, and snippets.

@perfectacle
Last active March 10, 2020 05:21
Show Gist options
  • Save perfectacle/073cb4472a34831a854b1bc32e89375a to your computer and use it in GitHub Desktop.
Save perfectacle/073cb4472a34831a854b1bc32e89375a to your computer and use it in GitHub Desktop.
Installation of OpenJDK 10 in AWS Elastic Beanstalk with ebextensions
# make shell script
files:
"/opt/elasticbeanstalk/tasks/install-openjdk-10.sh" :
mode: "000755"
owner: root
group: root
content: |
if [[ $(javac -version) != *"javac 10"* ]]
then
# please check recently openjdk version.
curl -O https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_linux-x64_bin.tar.gz
tar xvf openjdk-10*_bin.tar.gz -C /opt
# set java, javac path
alternatives --install /usr/bin/java java /opt/jdk-10.0.2/bin/java 2
alternatives --install /usr/bin/javac javac /opt/jdk-10.0.2/bin/javac 2
alternatives --set java /opt/jdk-10.0.2/bin/java
alternatives --set javac /opt/jdk-10.0.2/bin/javac
# set ${JAVA_HOME} path
alternatives --install /usr/lib/jvm/java java_sdk /opt/jdk-10.0.2 1
# change Root CA Certificates
rm -rf /opt/jdk-10.0.2/lib/security
cp -r /usr/lib/jvm/java-1.8.0-openjdk.x86_64/jre/lib/security /opt/jdk-10.0.2/lib/security
mv /opt/jdk-10.0.2/lib/security/java.policy /opt/jdk-10.0.2/lib/security/default.policy
# clear
rm -rf openjdk-10*_bin.tar.gz
fi
# execution shell script
commands:
install-openjdk-10:
command: /opt/elasticbeanstalk/tasks/install-openjdk-10.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment