I recently upgraded to Java7 on my Macbook Pro. I downloaded the JDK (not the JRE).
» javac version javac 1.7.0_17 » echo $JAVA_HOME /Library/Java/Java
Most probably javac is running from JRE and not JDK. tools.jar is only available in JDK. Confirm the path of javac/java by using which
which
which javac
Drag correct Java7 version to top in Java Preferences (Launchapad/Others). That should point A to JDK7.