Run executable file created by Matlab Compiler in Java: error of MCR
Show older comments
Hello,
I'm trying to call my executable file with a Java program. Here are the steps I followed:
- Compile the package including MCRinstaller.exe on my machine
- Double click on the package on the host machine: everything is properly installed
- The program can be run on the host machine without problem
- ...
- Call the .exe file from my Java program:
Process exec = Runtime.getRuntime().exe
c("C:\\Users\\cimlUser\\Desktop\\JAVA\\DiffusionLaw\\DiffusionLaw.exe");
The (same) program is not running:

Could you help me to understand why if I launch the exe file directly it works and when I launch it from Java there is an error?
Best regards.
Accepted Answer
More Answers (1)
Titus Edelhofer
on 4 Jun 2014
0 votes
Hi,
my first guess would be, that in your Java program the search path from Windows is not the same, i.e., it's missing the folder c:\program files\matlab\MATLAB Compiler Runtime\v715\runtime\winXY folder...?
Titus
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!