Unity Android Compilation Error

Here it is:

Failed to compile resources with the following parameters:
-bootclasspath “C:/Users/Zach/AppData/Local/Android/sdk\platforms\android-24\android.jar” -d “C:\Users\Public\Documents\Unity Projects\Platformer\Temp\StagingArea\bin\classes” -source 1.6 -target 1.6 -encoding UTF-8 “com\android\vending\billing\R.java” “com\Perkz\runSpacemanRun\R.java” “com\unity\purchasing\R.java” “com\unity\purchasing\amazon\R.java” “com\unity\purchasing\googleplay\R.java” “com\unity\purchasing\samsung\R.java” “com\unity3d\ads\android\R.java”
warning: C:\Users\Zach\AppData\Local\Android\sdk\platforms\android-24\android.jar(java/lang/Object.class): major version 52 is newer than 51, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: C:\Users\Zach\AppData\Local\Android\sdk\platforms\android-24\android.jar(java/lang/AutoCloseable.class): major version 52 is newer than 51, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
2 warnings

UnityEditor.HostView:OnGUI()

Windows 10 64 bit.

The error message means the version of Java that is used cannot run some of the compiled code, since it is from a newer version:

major version 52 is newer than 51, the
highest major version supported by
this compiler. It is recommended that
the compiler be upgraded.

What JDK version do you have installed ?

Please install JDK 8 and see if the issue still happens.

If the issue persists, you can use this service to have a look at your project and fix your build issues.

Uninstalling the old JDK 7 solved for me too.
I had not to reboot, just uninstalled and rebuilt. Unity asked me the folder of JDK and I selected C:\Program Files (x86)\Java\jre1.8.0_121