Download the Linux or Linux 64 package (not the RPM) from Oracle at http://java.com/en/download/manual.jsp
since it probably does not exist by default.
Extract the jre-7u21-linux.tar.gz file you downloaded into /usr/java
cd /usr/java && tar xzf jre-7u21-linux.tar.gz
You will have something like:
So in your .bashrc file (or however you set up your environmental variables for EC2) add: