SLIDER-777 Provide slider dependencies as a self contained versioned tarball - accept system property as a higher priority
diff --git a/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java b/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
index 5f5599c..b9c7b8e 100644
--- a/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
+++ b/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
@@ -1884,12 +1884,19 @@
   }
 
   /**
-   * Retrieve the HDP version if it is an HDP cluster, or null otherwise
+   * Retrieve the HDP version if it is an HDP cluster, or null otherwise. It
+   * first checks if system property HDP_VERSION is defined. If not it checks if
+   * system env HDP_VERSION is defined.
    * 
-   * @return HDP version
+   * @return HDP version (if defined) or null otherwise
    */
   public static String getHdpVersion() {
-    return System.getenv(SliderKeys.HDP_VERSION_PROP_NAME);
+    String hdpVersion = System
+        .getProperty(SliderKeys.HDP_VERSION_PROP_NAME);
+    if (StringUtils.isEmpty(hdpVersion)) {
+      hdpVersion = System.getenv(SliderKeys.HDP_VERSION_PROP_NAME);
+    }
+    return hdpVersion;
   }
 
   /**