Beginning with MATLAB 6.0 (R12), MLM_LICENSE_FILE can be set to make sure MATLAB is using a specific license file (or server(s) for network licenses). LM_LICENSE_FILE environment variable can also be set to do this, but any FLEXlm application will then use it. MLM_LICENSE_FILE is specific to the MATLAB vendor daemon, MLM, and will not be recognized by other FLEXlm applications.
Note: MATLAB may still read the LM_LICENSE_FILE variable if it is set, before it reads MLM_LICENSE_FILE. One of these variables must be set for clients of a redundant server triad to function properly.
How you find or set these environment variables depends on your Operating System:
1. Open the System Properties window by pressing the Windows key and “R”. This will open the Run window. Type the following Run command:
Then hit enter.
2. Next click the Environment Variables button near the bottom.
3. Under the User variables and System variables, check for a LM_LICENSE_FILE and MLM_LICENSE_FILE variable.
4. Go to New to make one of these variables (this can be set under user or system, depending on the desired usage). The variable name will be:
and the value will either be the full path to the license file or port@host, for example:
If you are using a redundant server triad, use commas to separate the servers, for example:
Linux/Unix/Mac OS X 10.9 and below
This can be done in the shell using the setenv or export command depending on the shell. You can either type the command in a shell session (which will make it only last for the session) or you can add it to the appropriate file in your home directory (or create that file if it doesn't exist):
.cshrc (for c-shell)
.profile or .bashrc (for bash)
The . before the file means this is a hidden file. To edit this file, you will need to open it up in a basic text editor and add the command (depending on your shell):
Examples, on c-shell:
setenv MLM_LICENSE_FILE "/usr/local/MATLAB/licenses/license.dat"
setenv MLM_LICENSE_FILE "1711@server1"
Examples, on bash:
Please refer to your Operating System documention for more information on setting an environment variable.
Mac OS X 10.10 and above
Apple is in the process of depreciating environment variables, so see this article for a workaround if you are on OS X 10.10 "Yosemite" or higher: