HUE-1208 [core] Add safety check to ensure the right JDK is being used

How to specify a 1.7 version for the 'apps' target targets:
MAVEN_OPTIONS="-DjavaVersion=1.7" make apps

Requires Maven 2 instead of 3.