有没有人人来了一个良好的配置脚本来使用存储在.ebextensions.我使用的弹性魔豆的tomcat7版本,我可以使用下面的百胜安装OpenJDK的:
Has anyone one come up with a good config script to install Oracle Java 1.7 in to an Elastic Beanstalk instance using the config files stored in .ebextensions. I am using a tomcat7 version of elastic beanstalk and I was able to install openJDK with yum using the following:
packages:
yum:
java-1.7.0-openjdk: []
java-1.7.0-openjdk-devel: []
commands:
use_java7:
command: alternatives --set java /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
我怎么会永远喜欢用甲骨文的Java 1.7不是的OpenJDK和百胜集团没有在它的回购本身。
How ever I would like to use Oracle Java 1.7 not OpenJDK and yum does not have that in it's repo natively.
试试这个配置文件
files:
"/home/ec2-user/install-oracle-jdk.sh":
mode: "000755"
owner: ec2-user
group: ec2-user
content: |
#!/usr/bin/env bash
wget -O jdk-7u25-linux-x64.rpm --no-cookies --no-check-certificate --header 'Cookie:gpw_e24=http://www.oracle.com; oraclelicense=accept-securebackup-cookie' 'http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.rpm'
rpm -Uvh /home/ec2-user/jdk-7u25-linux-x64.rpm
alternatives --install /usr/bin/java java /usr/java/default/bin/java 3
alternatives --set java /usr/java/default/bin/java
commands:
execute-install-oracle-jdk-script:
command: ./install-oracle-jdk.sh
cwd: /home/ec2-user