3

I'm trying to execute a matlab function in a Java project, from a jar compiled with MCR v95. However, when I try it from my java code (using eclipse IDE) suddenly an error window appear with some unicode caracters (chinese letters among them).

Screenshot of the error message: Error message

I reinstalled the Matlab runtime several times and assured that the runtime folder is in the path but the problem still persists.

Could anyone understand the error message or advice me to solve the problem?

Thank you in advance

UPDATE

In some of my tests (executing from another folder and from jar instead from eclipse console), I have obtained a more readable error but still don't know how to addres it. Please see image below:

New error message

CoolLo0 is an abreviation of the matlab jar used

  • 2
    Hi Josep, I cannot help you with the specific problem, but I am sure that it is not Chinese message, but some unicode(I guess). Currently I have no clue to crack it. :( – Hunter Jiang Feb 03 '20 at 15:20
  • As Hunter has clarified, that seems random unicode (the second character is greek), so its not a particular Chinese problem, but something to do with encoding. With the length of the message, I'd say it was written in ASCII but its being displayed in unicode. No idea how to fix it – Ander Biguri Feb 03 '20 at 15:24
  • 1
    The MATLAB GUI is a Java program, and MATLAB carries its own JVM. I bet this is a problem of compatibility between your Java and MATLAB’s. Try running MATLAB with the `-nojvm` option. – Cris Luengo Feb 03 '20 at 15:31
  • Could well be: the JVM that ships with Matlab is old. MCR v95 is R2018b, and that (currently) ships with Java 1.8.0u152. You might well be running a newer Java in Eclipse, and there were significant changes to the JVM in Java 9. – Andrew Janke Feb 03 '20 at 15:37
  • 1
    @CrisLuengo I don't use MATLAB GUI, I execute the matlab function from an integration test in a SpringBoot test project. So, I don't know how to add this option. I just add two libraries in the project, the javabuilder from v95 runtime and the jar with the function as suggested in the doc, and I use the classes from the jar. – Josep Pijuan Feb 03 '20 at 16:06
  • You need to add this option when creating the MCR, I think. – Cris Luengo Feb 03 '20 at 16:07
  • Yep: `mcc -R -nojava` when you're compiling your CTF. – Andrew Janke Feb 03 '20 at 16:44
  • @AndrewJanke according to mcc [doc](https://es.mathworks.com/help/compiler/mcc.html) -R options is used only standalone applications, and this is not the case, I only use a class compiled in a jar file. Despite this I've tried 'mcc -R -nojvm` and this is the error message: _Error: The option -R is invalid in library or component mode (specify -? for help)_. – Josep Pijuan Feb 04 '20 at 10:11
  • Aww, darnit. Sorry. – Andrew Janke Feb 04 '20 at 21:08

0 Answers0