Though you have installed and using a particular Java installation (E.g. Oracle Java 7), sometimes when you install some other softwares they might change the default to other Java installations (E.g. OpenJDK)
In such situations to change the default version, run the following commands and chose the appropriate selection when prompted.
For Java :
update-alternatives --config javaFor Java compiler :
update-alternatives --config javacFor Java web start :
update-alternatives --config javaws