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:
- Open Windows Search and type “Environment Variables.”
- Select “Edit the system environment variables.”
- Click “Environment Variables…”
- 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.