Run executable file created by Matlab Compiler in Java: error of MCR
显示 更早的评论
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.
采纳的回答
更多回答(1 个)
Titus Edelhofer
2014-6-4
0 个投票
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
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!