Permalink
Browse files

Look for NIMBUS_HOME system property first.

Fallback to environment variable.
  • Loading branch information...
1 parent 7c3f696 commit 93c80f88365028b5cbf555fc215f0601f3c3eca0 @labisso labisso committed with timf Jun 1, 2010
Showing with 13 additions and 7 deletions.
  1. +13 −7 service-api/java/source/src/org/nimbustools/api/brain/NimbusHomePathResolver.java
@@ -25,20 +25,26 @@
private static final Log logger =
LogFactory.getLog(NimbusHomePathResolver.class.getName());
- private static String NIMBUS_HOME_ENV_NAME = "NIMBUS_HOME";
+ public static String NIMBUS_HOME_ENV_NAME = "NIMBUS_HOME";
private static String PATH_PREFIX = "$"+NIMBUS_HOME_ENV_NAME;
private File nimbusHome;
private void initializeNimbusHome() {
- final String nimbusHomePath = System.getenv(NIMBUS_HOME_ENV_NAME);
+ String nimbusHomePath = System.getProperty(NIMBUS_HOME_ENV_NAME);
if (nimbusHomePath == null || nimbusHomePath.trim().length() == 0) {
- throw new RuntimeException("The " + NIMBUS_HOME_ENV_NAME +
- " environment variable is not set or is empty. " +
- "It should be set to the root Nimbus installation " +
- "directory by the Nimbus bootstrap scripts."
- );
+
+ nimbusHomePath = System.getenv(NIMBUS_HOME_ENV_NAME);
+
+ if (nimbusHomePath == null || nimbusHomePath.trim().length() == 0) {
+
+ throw new RuntimeException("The " + NIMBUS_HOME_ENV_NAME +
+ " environment variable is not set or is empty. " +
+ "It should be set to the root Nimbus installation " +
+ "directory by the Nimbus bootstrap scripts."
+ );
+ }
}
this.nimbusHome = new File(nimbusHomePath);

0 comments on commit 93c80f8

Please sign in to comment.