Java Program crashing when launch from Matlab 2019a

12 ビュー (過去 30 日間)
Don Ellison
Don Ellison 2023 年 4 月 19 日
コメント済み: Don Ellison 2023 年 4 月 19 日
I have a java program (.jar file) that i wish to run from Matlab 2019a.
As far as launching it goes it goes seemingly smoothly, When i click the button to launch it, it takes about 5-7 seconds and then launches fine.
From there i can navigate the program fine and some functionality of the program does infact work. Its just when i click on a certain button of the program it starts to load forever
When the program is launched from the command line it works perfectly and the same button performs near instantaneously
I just want to know where the problem could lie. Should i look more into the java program to find out what that function does differently than other functions that work with Matlab 2019a or could the issue lie with how i launch the program from Matlab. I launch it with this command:
fullpath = mfilename('fullpath')
javacmd = ['START "" /B "C:\Program Files\Java\jdk1.8.0_361\bin\java.exe" -Djna.library.path="C:\bit9prog\dev\app1\Project1\bin;" -jar ' fullpath '\..\..' '\java\Project1\target\Project1.jar'];
dos_cmd = sprintf('%s %s %s %s', javacmd, pwd);
system(dos_cmd);
If i need to give more background information for clarity do let me know
  1 件のコメント
Don Ellison
Don Ellison 2023 年 4 月 19 日
Also if anyone knows how to get output from the java program when launched from matlab it would be very helpful
For instance when launched from my terminal i use
>> Output.txt
To save all System.out.println()'s to a file called output.txt created by the program. However im not seeming to get much success from trying to include that line of code in my MATLAB launch code above but i could be inputting it wrong

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Java from MATLAB についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by