yum install java-1.7.0-openjdk.x86_64
yum install java-1.8.0-openjdk.x86_64
git clone https://github.com/gcuisinier/jenv.git ~/.jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(jenv init -)"' >> ~/.bash_profile
jenv add /usr/lib/jvm/jre-1.7.0-openjdk.x86_64
jenv add /usr/lib/jvm/jre-1.8.0-openjdk.x86_64
jenv versions
* system (set by /home/ec2-user/.jenv/version)
1.7
1.7.0.121
1.8
1.8.0.121
openjdk64-1.7.0.121
openjdk64-1.8.0.121
jenv global 1.7
jenv versions
system
* 1.7 (set by /home/ec2-user/.jenv/version)
1.7.0.121
1.8
1.8.0.121
openjdk64-1.7.0.121
openjdk64-1.8.0.121
java -version
java version "1.7.0_121"
OpenJDK Runtime Environment (amzn-2.6.8.1.69.amzn1-x86_64 u121-b00)
OpenJDK 64-Bit Server VM (build 24.121-b00, mixed mode)
Recommended Posts