title: ClassNotFoundException when running executable jar
body: <p>I created a jar file for utility files and added it as a dependency for my main project. When I run <code>mvn install</code> to build my main project, the correct utility jar is used in my unit tests. </p>
  
  <p>However, when I later run the main project jar using <code>java -jar supervisor.jar</code>, I get a <code>java.lang.NoClassDefFoundError:</code> caused by <code>java.lang.ClassNotFoundException: com.seeq.utilities.process.OperatingSystem</code>.</p>
  
  <p>In my unit tests, <code>OperatingSystem</code> is used and the tests run fine, so I am assuming that the utility jar is not found when by java when using <code>java -jar</code>. Is that the issue and how could I fix it?</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: com/seeq/utilities/process/OperatingSystem
      at com.seeq.supervisor.util.ProcessManager.buildCommand(ProcessManager.java:78)
      at com.seeq.supervisor.util.ProcessManager.&lt;init&gt;(ProcessManager.java:27)
      at com.seeq.supervisor.Supervisor.start(Supervisor.java:40)
      at com.seeq.supervisor.Main.main(Main.java:21)
  Caused by: java.lang.ClassNotFoundException: com.seeq.utilities.process.OperatingSystem
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      ... 4 more
  </code></pre>
  
  <p>How I added the dependency in my pom.xml:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.seeq.utilities&lt;/groupId&gt;
      &lt;artifactId&gt;seeq-utilities&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
      &lt;scope&gt;system&lt;/scope&gt;
      &lt;systemPath&gt;${project.basedir}/../common/libraries/java/seeq-utilities/target/seeq-utilities-1.0.jar&lt;/ systemPath&gt;
  &lt;/dependency&gt;
  </code></pre>