Java error when building

I have tried adding a system variable in environment variable called JAVA_HOME with the path as my Java folder: C:\Program Files (x86)\Java\jre7\bin

but I still get the error as follows.

I am getting this error when building my android project:

Error building Player: Win32Exception: ApplicationName='C:\Program Files (x86)\Java\jre7\bin\javac.exe', CommandLine='-bootclasspath "C:/Users/Shay/Documents/Android SDK/adt-bundle-windows-x86_64-20140702/sdk/platforms/android-20\android.jar" -d "C:\Users\Shay\Documents\FlappyBirdTest\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\google\android\gms\" "com\google\example\games\basegameutils\" "com\google\example\games\mainlibproj\" "com\ShadowKingdomStudios\ChickenWings\"', CurrentDirectory='C:\Users\Shay\Documents\FlappyBirdTest\Temp\StagingArea\gen'

This is the full error. If anyone knows how to fix this, it would be great help.

Once and I had something similar. Simply update your Java as the current version incorrectly works in the SDK Andtroid version. Generally it is better to set the last Unity, Java and SDK versions. And the second, it is recommended to SDK Android to unpack in a root folder of a disk, i.e. “C:/Android SDK/”.