OK, so I’m going to deploy a Play 2 app, backed by MySQL, into AWS. I am using RDS for the MySQL instance, so I’m not expecting any trouble there, but my code does use Java 1.7, as does my Play 2 framework.
If you use the standard AWS AMI for 64 bit Linux (amzn-ami-pv-2013.03.1.x86_64-ebs (ami-05355a6c)) you will get Java 1.6 by default. To be fair to Amazon, the AMI does include the Java 1.7 openjdk, but it doesn’t use it by default, you have to upgrade, and here’s how you do that after opening an SSH connection to your running instance:
sudo yum install java-1.7.0-openjdk
All good so far, but then when I typed java -version it was still using 1.6. So this is the little nugget I am recording in the hope that it might save you an hour of searching.
To actually switch to using Java 1.7 you need to use the following:
sudo alternatives --config java
This will show both and you just choose 1.7. Easy when you know how, impossible when you don’t.