Adding to Bhargavi's update, before upgrading , kindly check if the JDK 1.7 is compatible by checking the FMW certfication matrix.
Here's the link for 12.x versions.
There are simple instructions documented in the below Note. Please follow them.
How To Change The JDK Type (Sun / JRockit) or JDK Version for a Given FMW 11g Domain (Doc ID 1058804.1)
Hope this helps!!