What you are doing is changing the JAVA version for MATLAB and all the toolboxes. You don't need to do that, revert this change.
For Compiler SDK, create an environment variable JAVA_HOME and set it to the JDK path. What you have installed is JRE. Please install the JDK. For example, JAVA_HOME will look like:
This will ensure that Compiler SDK uses JDK 1.7 to convert the .m files into .jar files. Meanwhile, MATLAB and other products will continue to use JRE 7 that is shipped with MATLAB.
More info can be found here