Table of Contents
This is a record when I make OpenJDK 1.8.0 default version in AWS EC2.
Environment
- AWS EC2 Amazon Linux
Procedure
Install OpenJDK 1.8.0
First, I installed OpenJDK 1.8.0.
1 |
sudo yum install java-1.8.0-openjdk |
Change default version
As the following, I changed the default Java version.
1 2 3 4 5 6 7 8 9 10 |
$ sudo /usr/sbin/alternatives --config java There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java 2 /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java Enter to keep the current selection[+], or type selection number: 2(Enter) |
Confirmation
I confirmed that I changed the version by executing java -version
.
1 2 3 4 |
$ java -version openjdk version "1.8.0_101" OpenJDK Runtime Environment (build 1.8.0_101-b13) OpenJDK 64-Bit Server VM (build 25.101-b13, mixed mode) |