Changes to allow the app to run with openJDK 7 on OS X.

These changes will allow the code to run on openJDK 7 under OS X. This is a preprerequisite for building the IDE without java 6 dependency. 

https://github.com/arduino/Arduino/issues/1665