The default version in 12.04 is OpenJDK 6 (
default-jre) (although OpenJDK 7 is installable). The default in 12.10 is OpenJDK 7.
OpenJDK is an open-source implementation of the Java specification. It is generally fully compatible with the "official" Oracle/Sun Java implementation (but there are a few edge cases where parts of the original JDK were licence encumbered, eg with fonts where the implementations can slightly differ). This question discusses the issue a bit.
Unless there are features in Java 7 you really want to use, I would recommend targeting OpenJDK 6, which should work with the vast majority of Java installations, both on Ubuntu and other platforms.