1

I am trying to use matlab from java using the java engine (Working on Ubuntu 16.04 and the trial of Matlab 2017a. Also, I'm following the code posted in the official page of Matlab ( https://www.mathworks.com/help/matlab/matlab_external/execute-matlab-functions-from-java.html) with the example of obtain the roots of some numbers. I added in the Java build path the external Jars and the native library location. After all of this, the code does not present any error. But running the code, it shows the next exception at the moment i enter my Matlab account and the password:

Exception in thread "main" com.mathworks.engine.EngineException: Unable to launch MATLAB.
at com.mathworks.engine.MatlabEngine.open(MatlabEngine.java:334)
at com.mathworks.engine.MatlabEngine.startMatlab(MatlabEngine.java:143)
at LoadImageFromFile.ReadImage.main(ReadImage.java:26)

What I need to do? There's something that I am forgetting?

1 Answers1

0

I had the same problem when I upgrated from Matlab 2016b to 2017b , you have to keep matlab closed when calling it from Java

Nicole Ramírez
  • 345
  • 3
  • 19