From 49a3763b9ecdc77ec7d344ece8a6b847fa435679 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 29 Jan 2008 16:35:56 +0000 Subject: [PATCH] system property should take a higher priority than environment variable, as environment variables inherit from processes to processes, system properties don't. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6904 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/WebAppMain.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index a8026dcb8c..72374e498e 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -208,15 +208,15 @@ public class WebAppMain implements ServletContextListener { // ignore } - // look at the env var next - String env = EnvVars.masterEnvVars.get("HUDSON_HOME"); - if(env!=null) - return new File(env.trim()).getAbsoluteFile(); - // finally check the system property String sysProp = System.getProperty("HUDSON_HOME"); if(sysProp!=null) return new File(sysProp.trim()); + + // look at the env var next + String env = EnvVars.masterEnvVars.get("HUDSON_HOME"); + if(env!=null) + return new File(env.trim()).getAbsoluteFile(); // otherwise pick a place by ourselves