Compiled matlab executables not working correctly with java archives

2 ビュー (過去 30 日間)
Sean
Sean 2012 年 1 月 30 日
編集済み: ES 2013 年 10 月 7 日
I have several programs that I wrote in matlab that use external custom java archives. The programs work fine on my computer (with the matlab license) (as .m files). They also work on the same computer as compiled executables with the main matlab install not running.
When I put them on another PC with the MCR installed (and the relevant libraries as checked/verified with non-matlab programs), the executables do not work. At best, they flash a quick empty figure window before terminating.
I have verified that the java archives appear to have the same paths on the new PC. I have also made a point of adding the directory containing the archives to the system OS path.
What could cause my compiled executables to fail to find and use my java archives? (Note: I have verified that executables not using the archives appear to work as expected, so the MCR is presumably installed correctly).
Thanks in advance, Sean

回答 (1 件)

Kaustubha Govind
Kaustubha Govind 2012 年 1 月 31 日
In general, you are discouraged from using functions like ADDPATH with absolute paths from deployed applications. See Path Management in Deployed Applications. I think the solution for your case might be to add the required JAR-files to the CTF archive (using the mcc -a option) and then add them relative to ctfroot.
  7 件のコメント
Sean
Sean 2012 年 2 月 8 日
Thanks for the clarification... Unfortunately, when I use the string "javaaddpath({[ctfroot 'DiagIF.jar'], [ctfroot 'AVIO.jar']});" at the beginning of the code and include the .jar files in the 'additional files' section, the results do not change.
Any further ideas?
Thanks in advance.
Kaustubha Govind
Kaustubha Govind 2012 年 2 月 9 日
Oops, sorry, you need "javaaddpath({[ctfroot '/DiagIF.jar'], [ctfroot '/AVIO.jar']});". You need the "/" to separate the ctfroot path from your filename.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by