How do I correctly install the Facebook SDK plugin?

My current process is approximatly:

I start with a Disk image of Window 7 x64 with only:

  • Unity 4.3.3f1, Located ‘C:\Program Files(x86)\Unity’.
  • The adt-bundle-windows-x86-20131030. ‘C:\Users\Will\adt…’.
  • The Java 32bit runtime 1.7.0_51-b13, ‘C:\Program Files(x86)\Java’.
  • ‘C:\Program Files(x86)\Java\jr7\bin;’ is manually added to my ‘Path’ Environment Varible.

As it is I can cleanly deploy Android projects, however I want to use the official Facebook SDK plugin.
At this point on my first attempt to install the plugin I dropped it into a project as per the official ‘Getting Started’ tutorial and this is where I get a bit lost.
Even though there is no mention of it in the ‘Getting Started’ tutorial I find that OpenSSL is a dependancy of the SDK.

So I install the OpenSSL binary ‘Win32OpenSSL-1_0_1f’ to ‘C:\Program Files(x86)\OpenSSL-Win32’ and when the plugin still can’t find it I add ‘C:\Program Files(x86)\OpenSSL-Win32\bin;’ to my ‘Path’ Environment Variable.

At this point The plugin’s ‘Debug Key Hash’ starts working and I naievly assume that everything is correct, However; When I attempt to deploy a build I recieve the following error:

Error building Player: Win32Exception: ApplicationName='C:\Program Files (x86)\Java\jre7\bin\javac.exe', CommandLine='-bootclasspath "C:/Users/Will/adt-bundle-windows-x86-20131030/adt-bundle-windows-x86-20131030/sdk/platforms/android-19\android.jar" -d "C:\Users\Will\Documents\Unity Projects	est\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding ascii "com\DefaultCompany	est\R.java" "com\facebook\android\R.java"', CurrentDirectory='C:\Users\Will\Documents\Unity Projects	est\Temp\StagingArea\gen'

and the build process is halted.

Could anyone help explain where I am going wrong and to get this plugin to behave?

After asking the same question on the Facebook specific StackOverflow I found out that the plugin requires a copy of the JDK to be installed and for the JAVA_HOME environment variable to be pointing to it’s bin folder.

In my particular case this looked as follows:

  • jdk-7u51-windows-i586.exe installed to: ‘C:\Program Files (x86)\Java\jdk1.7.0_51’.
  • JAVA_HOME Environment variable created, pointing to: ‘C:\Program Files (x86)\Java\jdk1.7.0_51\bin’.