Fix: Java agent should use LTTNG_HOME
[lttng-ust.git] / liblttng-ust-java-agent / java / org / lttng / ust / agent / LTTngTCPSessiondClient.java
index 76e8426b2344cad4f67b8b9e39386f2d493ad343..78dae5e5f4b4ba5f0320660dafcc0349d196ad03 100644 (file)
@@ -262,7 +262,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.022861 seconds and 4 git commands to generate.