title: Problems with MATLAB Engine API for Java
body: <p>Im am trying to compile this piece of code:</p>
  
  <pre><code>import com.mathworks.engine.*;
  
  public class javaEvalFunc {
      public static void main(String[] args) throws Exception {
          MatlabEngine eng = MatlabEngine.startMatlab();
          eng.evalAsync("[X, Y] = meshgrid(-2:0.2:2);");
          eng.evalAsync("Z = X .* exp(-X.^2 - Y.^2);");
          Object[] Z = eng.getVariable("Z");
          eng.close();
          }
  }
  </code></pre>
  
  <p>I found it on this web page: <a href="https://www.mathworks.com/help/matlab/matlab_external/evaluate-matlab-expression-from-java.html" rel="nofollow noreferrer">https://www.mathworks.com/help/matlab/matlab_external/evaluate-matlab-expression-from-java.html</a></p>
  
  <p>As you can see I need a reference to com.mathworks.engine.*;</p>
  
  <p>This Page <a href="https://www.mathworks.com/help/matlab/matlab_external/setup-environment.html#bvcubp5" rel="nofollow noreferrer">Mathworks Engine Info</a> says that the .jar file that I need to Add is in this Path:</p>
  
  <p>matlabroot/extern/engines/java/jar/engine.jar</p>
  
  <p>But in my computer I just have a folder called phyton in this path</p>
  
  <p>matlabroot/extern/engines</p>
  
  <p><a href="https://i.stack.imgur.com/us63e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/us63e.png" alt="Image"></a></p>
  
  <p>Where can Ifind the .jar file that I need ?</p>
  
  <p>I am using Eclipse IDE by the way.</p>