title: How to access sys.preferredJre from a script in install4j?
body: <p>My application uses authentication through a LDAP server over SSL. This requires installation of certificates in the bundled JRE's keystore. I use a script to do it through Java code and in the process need to find the location of the installed JRE. This script is executed at the end of the installation.</p>
  
  <p>On Windows, it's relatively simple: I just use <code>context.getInstallationDirectory()</code> and then add <code>jre\lib\security\cacerts</code>. </p>
  
  <p>On Mac OS, however, the JRE is installed in a different location and I would need to use the actual <code>sys.preferredJre</code> or the <code>java.home</code> property. The problem is that I can't access them from the scripts. The context object doesn't seem to have the corresponding methods. <code>System.getProperty("java.home")</code> returns a temporary location where the JRE is probably first unpacked and not the final path. 
  <code>context.getCompilerVariable("sys.preferredJre")</code> returns null.</p>
  
  <p>As a side note, there doesn't seem to be any logging from inside the scripts. All I get is a brief message about the script succeeding or failing. I had to write to a custom file to get any information.</p>
  
  <p>Can you suggest a way to handle this? Ideally, I would like to do it in OS-independent way and just get the Jre directory.</p>
  
  <p>Thanks in advance</p>
  
  <p>Sasha</p>