Fix: Java agent should use LTTNG_HOME
[lttng-ust.git] / liblttng-ust-java-agent / java / org / lttng / ust / agent / LTTngTCPSessiondClient.java
index d376f672e5e04c39c97a02100f0690b52f4d3546..e249492315fc99e653ec379baf20e90ae6ee4232 100644 (file)
@@ -245,7 +245,16 @@ class LTTngTCPSessiondClient implements Runnable {
        }
 
        private static String getHomePath() {
-               return System.getProperty("user.home");
+               /*
+                * The environment variable LTTNG_HOME overrides HOME if
+                * defined.
+                */
+               String homePath = System.getenv("LTTNG_HOME");
+
+               if (homePath == null) {
+               homePath = System.getProperty("user.home");
+               }
+               return homePath;
        }
 
        /**
This page took 0.025647 seconds and 4 git commands to generate.