CLOUDSTACK-6926 setting java_home from installed java

changed the order of preference to check for java first.

Usage server rpm installs JRE 1.7. In the case where JDK 1.6 is already
installed, java version would be 1.7 but, javac would be 1.6
If javac is given preference, usage server fails to start in this case.