Usage in compiled Matlab application

I’m not sure if this is the right place, but I’m having some trouble running Orekit (compiled from source using Eclipse) from compiled Matlab code. I use the commands ‘javaaddpath’ followed by ‘import org.orekit.foo.*’, which works just fine with uncompiled Matlab and about half the time with compiled Matlab, depending on what order I call my executables.

Does anybody here have any experience using Orekit with Matlab, specifically compiled Matlab (that is then run using the MCR)? Is there a better way than ‘javaaddpath’ to add the Orekit/Hipparchus jars to the java class path?

@russell I don’t have experience with compiled MATLAB but I doubt that the compiler knows how to include Java libraries (archives) and link them. For this reason I gave up on using Orekit from MATLAB and went to full Java. I am using MATLAB only to make pretty plots of the results.
Regards,
BU

Thanks, @bogdan.udrea

I actually discovered a couple issues with my code - one, including the jars when compiling Matlab avoids the javaaddpath issue (it automatically puts the jars on the Matlab static java path, rather than waiting for javaaddpath to add them to the dynamic path). Second, I had an exception that wasn’t being handled properly and was just disappearing, so I didn’t see the error that no UTC-TAI history had been loaded. It was the combination of these two errors that produced the behavior I was seeing.

@russell
That’s excellent. I was only able to load Orekit jars in MATLAB by specifying the static java path in a configuration file. Do you mind my asking what compiler have you been using?
Regards,
BU

@bogdan.udrea
We’re using the Matlab R2017b and running the compiled application with the Matlab Compiler Runtime (MCR) 9.3.

Here is the post that I got this info from, but it was for a significantly older version of Matlab.

Thanks @russell. That’s the workaround I’ve been using in plain MATLAB to get access to Orekit jars. Glad to hear it works for compiled MATLAB. I’ll try it eventually. Regards.
BU