title: java.lang.NoClassDefFoundError: mpi/MPIException
body: <p>I want to use open-mpi for java.
  I got the last version of open-mpi here <a href="https://www.open-mpi.org/software/ompi/v4.1/" rel="nofollow noreferrer">https://www.open-mpi.org/software/ompi/v4.1/</a>
  Then install it using the next commands:</p>
  <p>sudo ./configure --prefix=/Users/user/openmpi --disable-mpi-fortran --disable-mpi-cxx --disable-mpi-cxx-seek --disable-openib-dynamic-sl --disable-openib-connectx-xrc --disable-openib-udcm --disable-openib-rdmacm --disable-vt --disable-libompitrace --without-slurm --without-lsf --without-tm --without-ugni --without-mx --enable-mpi-java --with-jdk-dir=/Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home/ --with-threads=posix 2&gt;&amp;1 | tee config.out
  sudo make -j 4 2&gt;&amp;1 | tee make.out
  sudo make install 2&gt;&amp;1 | tee install.out</p>
  <p>So, there is mpi.jar in /Users/user/openmpi/lib</p>
  <p>I need to launch a test project from my teacher <a href="https://bitbucket.org/mathpar/dap/" rel="nofollow noreferrer">https://bitbucket.org/mathpar/dap/</a></p>
  <p>I added mpi.jar to Dependencies in Intellij Idea. Set up $PATH with /Users/user/openmpi/bin</p>
  <p>After building the project, I wanna run example target/classes/com/mathpar/NAUKMA/examples/HelloWorldParallel
  Here is command: mpirun -np 1 java -cp /Users/user/IdeaProjects/dap/target/classes com/mathpar/NAUKMA/examples/HelloWorldParallel</p>
  <p>I got: Error: Unable to initialize main class com.mathpar.NAUKMA.examples.HelloWorldParallel
  Caused by: java.lang.NoClassDefFoundError: mpi/MPIException</p>
  <p>I was trying to change either of params (-cp Classpath or path to file), but I got e.g.: Error: Could not find or load main class com.mathpar.NAUKMA.examples.HelloWorldParallel.java
  Caused by: java.lang.ClassNotFoundException: com.mathpar.NAUKMA.examples.HelloWorldParallel.java</p>
  <p>So I think that problem not in paths</p>
  <p>If you need more information, you are welcome</p>
  <p>Here is com.mathpar.NAUKMA.examples.HelloWorldParallel:</p>
  <pre><code>package com.mathpar.NAUKMA.examples;
  
  import mpi.*;
  
  public class HelloWorldParallel {
      public static void main(String[] args) throws MPIException {
          //iнiцiалiзацiя паралельної частини
          MPI.Init(args);
          //визначення номера процесора
          int myrank = MPI.COMM_WORLD.getRank();
          System.out.println(&quot;Proc num &quot; + myrank + &quot; Hello World&quot;);
          //завершення паралельної частини
          MPI.Finalize();
      }
  }
  </code></pre>