Why does a standalone MATLAB application fail to launch even when MATLAB is installed?

A standalone MATLAB application (*.exe) created using the standalone Application Compiler(standaloneApplicationCompiler) in MATLAB R2025b fails to launch. When attempting to run the application (e.g., applicationName.exe) from the Windows Command Prompt (cmd), the following error message appears:
>applicationName
Error: Could not find version 25.2 of the MATLAB Runtime.
Attempting to load mclmcrrt25_2.dll.
Install MATLAB Runtime R2025b.
Contact your vendor if you do not have an installer for the MATLAB Runtime.
Although the standalone application is being executed on the same computer where MATLAB was used to compile it, this error still occurs. Why does this happen? 

 Réponse acceptée

The standalone applications generally run with MATLAB without installing MATLAB Runtime. However, the error can arise especially when either the path for MATLAB or MATLAB Runtime is not present in Windows' environment variables.
According to the error message, the system is unable to locate the required mclmcrrt25_2.dll file, which should reside in the following directory under the MATLAB Runtime installation:
C:\Program Files\MATLAB\MATLAB Runtime\R2025b\runtime\win64
To resolve this, you need to install the appropriate version of MATLAB Runtime. Please run the following command on MATLAB, and get the download link to the runtime installer:
>> com.mathworks.toolbox.compiler.MatlabRuntimeUtils.getMCRInstallerDownloadURL()
However, even after installation, the application may still fail to launch if the above path is not included in your system’s environment variables (specifically, the Path variable). To add this path:
  1. Open Windows Search and type “Environment Variables.”
  2. Select “Edit the system environment variables.”
  3. Click “Environment Variables…”
  4. Edit the Path variable under System variables and add the following (using a semicolon as a separator):
C:\Program Files\MATLAB\MATLAB Runtime\R2025b\runtime\win64
If you encounter an error such as:
This environment variable is too large. This dialog allows setting values up to 2047 characters long.
it means that the total length of the Path variable exceeds the limit that can be edited via the GUI. In this case, you must use the Registry Editor (regedit) to modify the environment variable directly:
  • Press Windows Key + R, type regedit, and press Enter.
  • Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
  • On the right, double-click on the Path entry.
  • Manually append the following path to the end (using a semicolon as a separator):
C:\Program Files\MATLAB\MATLAB Runtime\R2025b\runtime\win64
  • Click OK to save.
  • Restart Windows for the changes to take effect.
After following these steps, your standalone MATLAB application should launch successfully.

Plus de réponses (0)

Catégories

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by