1) Download the JDK from http://jdk8.java.net/fxarmpreview/ and copy it into /home/pi
2) Un-tar it
tar -xzf jdk-8-ea-b36e-linux-arm-hflt-29_nov_2012.tar.gz
3) Create a soft link
ln -s jdk1.8.0/ java
4) Add it to your path (optional)
nano .bashrc
#add this line at the end
export PATH=$PATH:/home/pi/java/bin
#add this line at the end
export PATH=$PATH:/home/pi/java/bin
5) Log out and back in again to reload .bashrc
6) Check Java is now in your path
pi@raspberrypi ~ $ java -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b36e)
Java HotSpot(TM) Client VM (build 25.0-b04, mixed mode)
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b36e)
Java HotSpot(TM) Client VM (build 25.0-b04, mixed mode)