Setting Environment Variables
From Multiverse
Setting environment variables is optional for the server start scripts, but is often convenient to set values that you don't expect will change often. You may also need to set environment variables to:
- Run the Multiverse tools from the command line without changing your working directory to the directory where the specific tool is installed
- Run other applications, such as Java or Python.
The way you set envionment variables depends on whether you are using Linux or Cygwin/Windows or the Windows Command Prompt.
Linux and Cygwin/Windows
To set environment variables on Linux, edit the .bashrc in your home directory and add lines such as
export MV_HOME=/usr/local/multiverse
On Linux, the file name will be different (for example, .cshrc).
With Cygwin on Windows, the lines will look like this:
export MV_HOME="c:\multiverse"
NOTE: When using Cygwin on Windows, do not use Notepad or Wordpad for editing the .bashrc file. These editors are incompatible with Cygwin line endings. Use a Linux command-line text editor such as vi or emacs. You can also use any text editor that is compatible with Linux/Unix line endings. For example, a good free editor is PSPad.
Once you have edited the file as neccessary, the settings will take effect in all new shell windows opened. To make the settings take effect immediately in the current shell, enter this command:
source ~/.bashrc
Windows
To set an environment variable:
- Open Windows Control Panel
- Choose System. The System Properties dialog box opens.
- Choose the Advanced tab, then click Environment Variables. The Environment Variables dialog box opens.
- You can set environment variables just for the current user or the system. Either will work, but if another Windows user will be using the server, then set system variables.
- Click New.
- Enter the variable name and value, then click OK.
- Click OK in the Environment Variables dialog box, then OK in the System Properties dialog box.
You must open a new command window for the new settings to take effect. To confirm the environment variable settings in a command window, just enter set in the command prompt window. This will display all the current environment variable settings.
