RepreZen API Studio makes use of environment variables to provide extra diagnostic output. And some GenTemplates, such as the new API Docs for Confluence generator, use environment variables for user credentials and other sensitive information.


Setting Environment Variables

Some environment variables are used directly by API Studio for diagnostic purposes. You'll need to set these environment variables in your operating system prior to launching API Studio. 


Environment variables used in code generation can also be set in the operating system before launching API Studio, and this is usually the simplest and most reliable way to set them. However, API Studio runs code generation using an Eclipse Java Launch Configuration, and you can define and override environment variables directly in the launch configuration.  This can be useful in some troubleshooting scenarios. 


Note: Once you have set these environment variables in your primary OS environment, you will need to shut down API Studio completely restart. Using File > Restart is not recommended for this purpose. Use File Exit, ensure that the process is no longer running, and then restart. 

Enabling Launch Configuration Tools in API Studio

When working with environment variables, it's useful to be able to inspect them directly in API Studio, to make sure they were set correctly in your operating, and inherited into the running Eclipse environment. The built-in Launch Configuration UI is a convenient way to do this, but it's not visible by default in the RepreZen perspective.  Follow this one-time procedure to enable the Launch Action Set in API Studio:


  1. Right-click on the RepreZen perspective icon, then click Customize...
  2. In the Action Set Availability tab, click the checkbox for the Launch action set and click OK.

Using the Run Configurations Dialog to Inspect Environment Variables

  1. Once you've enabled the Launch tools in the RepreZen perspective, your toolbar should contain a Run Configurations split button, along with Debug and External Tools split buttons. Click the dropdown arrow immediately to the right of the Run Configurations button (plain green arrow), and select Run Configurations... from the drop-down menu.
  2. Select or create a run configuration, click the Environment tab, and click Select...
    This will show a list of all of the environment variables defined in the API Studio environment.
  3. If you are troubleshooting a Launch Configuration created by API Studio's code generation commands, you can select environment variables to override, and click OK. Otherwise, once you have verified that the environment variables are defined correctly and available in API Studio, you can cancel out of the open dialogs.