I use the Amazon Linux AMI on all my EC2 instances and they come with OpenJDK IcedTea pre installed on them. I have had few issues with OpenJDK when running some applications and I always install the Sun/Oracle JDK 6 on them. Below are the few easy steps / commands to download and install JDK 6 once you log in to the EC2 instance using an SSH client.
Oracle doesn't provide direct download URLs for JDKs anymore. I have updated the steps with the trick mentioned here to get the installation file with wget
Run java -version to make sure you have the Sun/Oracle JDK as your default jvm now.