What is the licensing order and license file search path for MATLAB?

95 views (last 30 days)
What is the order that MATLAB will use to search for licenses as of MATLAB R2008a or later?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Oct 2024
Edited: MathWorks Support Team on 18 Oct 2024
This Answer applies to a local installation of MATLAB. It does not apply to Docker installations of MATLAB. In each of the folders mentioned, MATLAB will search for a license.dat first and then any .lic file in alphabetical order.
The order that MATLAB will look at license files for MATLAB Desktop is as follows. #1 Is the first path MATLAB looks at, while #7 is the last:
  1. License_info.xml
  2. Specified license file/server
  3. Registry keys (Windows only)
  4. .flexlmrc directory (Linux and macOS only)
  5. Environment variables
  6. User-specific license folders
  7. Installation-specific license folders

 

1. License_info.xml

If there is a license_info.xml file in MATLAB's installation "licenses" folder or in the user-specific licenses folder, then MATLAB will look at this file and only this file for licensing. This also applies to licensing modes that specify "online" or "onlinelicensing" (usage example: matlab -licmode onlinelicensing).

 

2. Specified license file/server

If you point MATLAB to a specific license file or server with the -c argument, MATLAB will only look at the license file or license server specified with the -c argument. It will skip any of the next licensing paths it would look at (points 3-7.)

 

3. Registry keys (Windows only)

Either registry key will be checked to see if it points to a license file or license server:
  • HKEY_LOCAL_MACHINE\Software\FLEXlm License Manager\MLM_LICENSE_FILE
  • HKEY_LOCAL_MACHINE\Software\FLEXlm License Manager\LM_LICENSE_FILE

 

4. .flexlmrc directory (Linux and macOS only)

On Linux and macOS, MATLAB will look for a directory named .flexlmrc in the user's home directory (/home/$USER or ~). If the directory exists, it will look for license files in here.

 

5. Environment variables

MATLAB will check for environment variables MLM_LICENSE_FILE and LM_LICENSE_FILE to see if they are pointing to a license file or license server.

 

6. User-specific license folders

Each installation of MATLAB has a licenses folder that is user-specific. This exact location varies between platform and release.
Windows
%appdata%\MathWorks\MATLAB\R20XXy_licenses ex: C:\Users\james\AppData\Roaming\MathWorks\MATLAB\R2024b_licenses\
Linux
~/.matlab/R20XXy_licenses ex: /home/james/.matlab/R2024b_licenses/
macOS
~/Library/Application Support/MathWorks/MATLAB/R20XXy_licenses ex: /Users/$USER/Library/Application Support/MathWorks/MATLAB/R2024b_licenses

 

7. Installation-specific license folders

MATLAB has a licenses folder it will check for license files. Its exact location will vary depending on where you installed MATLAB. Below are some examples for each platform, when MATLAB is installed in the default location:
Windows
C:\Program Files\MATLAB\R20XXy\licenses
macOS
/Applications/MATLAB_R20XXy/licenses
Linux
/usr/local/MATLAB/R20XXy/licenses

More Answers (0)

Categories

Find more on Manage Products in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2008a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!