Setting Environment Variables

Setting environment variables differs for each operating system. Here’s a brief guide in case you can’t find your systems administrator.

Windows

1.   Go to Control Panel > System and Security > System.
2.   Click Advanced system settings in the left-hand panel and then the EnvironmentVariables button. You can specify system-wide variables that all users will pick up or user variables to restrict the environment variable to one particular user.
3.   Click on New and enter the variable name and value.

Mac

You can easily set an environment variable that is active in one terminal only:

1.   The procedure for setting an environment variable depends on what your default shell is. To get the name of the shell you are using, launch a terminal (Applications > Utilities > Terminal) and enter:

echo $SHELL.

2.   Depending on the output of the previous step, do one of the following:

If your shell is a csh or tcsh shell, enter:

setenv foundry_LICENSE /tmp/foundry.lic

If your shell is a bash or ksh shell, enter:

export foundry_LICENSE=/tmp/foundry.lic

You then need to run the product from the same terminal that you used to set the environment variable. If you open another terminal, this environment variable is not set in that terminal unless you type it in there too.

For a more permanent solution, you can set an environment variable for all processes launched by a specific user by creating an environment file in the user’s home directory:

~/.MacOSX/environment.plist

Note:  The tilde ( ~ ) represents the home directory of the target user, and the command is case sensitive, so take care to copy the string exactly.

You have to create the .MacOSX directory yourself using a terminal (by typing mkdir .MacOSX in your home directory). You also have to create the environment file yourself. The environment file is actually in XML/plist format (make sure to add the .plist extension to the end of the filename or this won't work). An example environment file is shown below. The file can be created using /Developer/Applications/Utilities/PropertyListEditor.app or you can use a text editor if you’re careful with the formatting. We can also send you one if you wish.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>foundry_LICENSE</key>

<string>/tmp/foundry.lic</string>

</dict>

</plist>

In this case we set the environment variable foundry_LICENSE to /tmp/foundry.lic. Note also that the environment variable is only active once you’ve logged out and logged back in.

Linux

1.   The procedure for setting an environment variable depends on what your default shell is. To get the name of the shell you are using, launch a shell and enter:

echo $SHELL.

2.   Depending on the output of the previous step, do one of the following:

If your shell is a csh or tcsh shell, enter:

setenv foundry_LICENSE /tmp/foundry.lic

If your shell is a bash or ksh shell, enter:

export foundry_LICENSE=/tmp/foundry.lic

3.   You then need to run the product from the same terminal that you used to set the environment variable. If you open another terminal, this environment variable is not set in that terminal unless you type it in there too.
4.   To make this permanent for any shell launched, you can edit your .cshrc, .tcshrc, .bashrc, or .kshrc file in your home directory.
5.   If you want it to be system wide, then /etc/profile can be used (or /etc/environment on some flavors of Linux).