Already answered this in the comments thread but for future reference:
Broadly speaking, the JDK package determines the version of the Java compiler (javac) you have and the JRE package determines the version of the Java interpreter (java) you have.
The version that is run when you type java or javac in the command line is the version that is listed in your PATH environmental variable, which will generally point to the newest version from the newest package (the Java installer does this for you).
The JDK will install the corresponding JRE at the same time so you'll have the same version of java and javac by just installing the latest JDK.
javacommand invokes the Java interpreter not the compiler so it would be found in a JRE package (i.e.jre7).javaccommand to compile. :)