title: Install4j - UndefinedVariableException for installer variable
body: <p>I know there has been a <a href="https://stackoverflow.com/questions/38605315/install4j-installer-variable-undefinedvariableexception">bug on this subject</a>, but it seems I'm still getting this error when the installer running on Linux environment (on windows it working fine).
  I'm using v6.1.6 [build: 6459]</p>
  
  <p>What I tried to do:</p>
  
  <ol>
  <li>I defined a <code>Set a variable</code> action in which I'm getting the <em>$JAVA_HOME</em> path if exists and set it to <code>linuxJavaHome</code> variable.</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/f4TUT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f4TUT.png" alt="enter image description here"></a></p>
  
  <ol start="2">
  <li>Later on - I defined <code>Run executable or batch file</code> action in which I'm getting the java version using the installer previous <code>linuxJavaHome</code> variable.</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/trxMo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/trxMo.png" alt="enter image description here"></a></p>
  
  <p>I checked my code on multiple Linux environments and the variable is defined just fine with the java home path. Moreover, I've also tried debugging my code to be sure and it seems OK.</p>
  
  <p><a href="https://i.stack.imgur.com/WOQ2A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WOQ2A.png" alt="enter image description here"></a></p>
  
  <p>My only problem is when I'm building and running our installer from JENKINS with silent mode (-q), I'm always getting this <em>UndefinedVariableException</em>. I refined the problematic point and it happens on the 1st <code>Set a variable</code> screen.</p>
  
  <p>The exception stacktrace is:</p>
  
  <pre><code>com.install4j.api.beans.UndefinedVariableException: installer:linuxJavaHome
  13:03:08 Error log: /home/administrator/installer/install4jError2195873440024941405.log
  13:03:08 com.install4j.api.beans.UndefinedVariableException: installer:linuxJavaHome
  13:03:08    at com.install4j.runtime.installer.InstallerVariables$InstallerReplacementCallback.handleError(InstallerVariables.java:971)
  13:03:08    at com.install4j.runtime.installer.InstallerVariables$InstallerReplacementCallback.getReplacement(InstallerVariables.java:950)
  13:03:08    at com.install4j.runtime.util.StringUtil.replaceVariable(StringUtil.java:68)
  13:03:08    at com.install4j.runtime.installer.InstallerVariables.replaceVariables(InstallerVariables.java:337)
  13:03:08    at com.install4j.runtime.installer.InstallerVariables.replaceVariables(InstallerVariables.java:326)
  13:03:08    at com.install4j.runtime.installer.InstallerVariables.replaceVariables(InstallerVariables.java:322)
  13:03:08    at com.install4j.runtime.installer.InstallerVariables.replaceVariables(InstallerVariables.java:362)
  13:03:08    at com.install4j.api.beans.AbstractBean.replaceVariables(AbstractBean.java:89)
  13:03:08    at com.install4j.runtime.beans.actions.misc.RunExecutableAction.getExecutable(RunExecutableAction.java:58)
  13:03:08    at com.install4j.runtime.beans.actions.misc.RunExecutableAction.execute(RunExecutableAction.java:292)
  13:03:08    at com.install4j.runtime.beans.actions.SystemInstallOrUninstallAction.install(SystemInstallOrUninstallAction.java:29)
  13:03:08    at com.install4j.runtime.installer.ContextImpl$7.executeAction(ContextImpl.java:1668)
  13:03:08    at com.install4j.runtime.installer.ContextImpl$7.fetchValue(ContextImpl.java:1659)
  13:03:08    at com.install4j.runtime.installer.ContextImpl$7.fetchValue(ContextImpl.java:1656)
  13:03:08    at com.install4j.runtime.installer.helper.comm.actions.FetchObjectAction.execute(FetchObjectAction.java:14)
  13:03:08    at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionDirect(HelperCommunication.java:274)
  13:03:08    at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionInt(HelperCommunication.java:259)
  13:03:08    at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionChecked(HelperCommunication.java:187)
  13:03:08    at com.install4j.runtime.installer.helper.comm.HelperCommunication.fetchObjectChecked(HelperCommunication.java:170)
  13:03:08    at com.install4j.runtime.installer.ContextImpl.performActionIntStatic(ContextImpl.java:1656)
  13:03:08    at com.install4j.runtime.installer.InstallerContextImpl.performActionInt(InstallerContextImpl.java:151)
  13:03:08    at com.install4j.runtime.installer.ContextImpl.performAction(ContextImpl.java:1103)
  13:03:08    at com.install4j.runtime.installer.controller.Controller.executeAction(Controller.java:368)
  13:03:08    at com.install4j.runtime.installer.controller.Controller.executeActions(Controller.java:334)
  13:03:08    at com.install4j.runtime.installer.controller.Controller.executeActionGroup(Controller.java:405)
  13:03:08    at com.install4j.runtime.installer.controller.Controller.executeActions(Controller.java:339)
  13:03:08    at com.install4j.runtime.installer.controller.Controller.executeActionGroup(Controller.java:405)
  13:03:08    at com.install4j.runtime.installer.controller.Controller.executeActions(Controller.java:339)
  13:03:08    at com.install4j.runtime.installer.controller.Controller.handleCommand(Controller.java:195)
  13:03:08    at com.install4j.runtime.installer.controller.Controller.handleStartup(Controller.java:116)
  13:03:08    at com.install4j.runtime.installer.controller.Controller.start(Controller.java:73)
  13:03:08    at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:59)
  13:03:08    at com.install4j.runtime.installer.Installer.main(Installer.java:46)
  13:03:08    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  13:03:08    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  13:03:08    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  13:03:08    at java.lang.reflect.Method.invoke(Method.java:498)
  13:03:08    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
  13:03:08    at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57)
  </code></pre>