title: NoClassDefFoundError while executing jar in intellij
body: <p>I am trying to execute a jar file, in terminal. </p>
  
  <p>Jar created in intellij:</p>
  
  <pre><code>Build -&gt; Build Artifacts -&gt; Clean
  Build -&gt; Build Artifacts -&gt; Build
  </code></pre>
  
  <p>Execution cmd:</p>
  
  <pre><code>java -jar helloworld.jar
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/json/simple/JSONObject
          at main.java.com.example.helloworld.sampleclass.mymethod(sampleclass.java:53)
          at main.java.com.example.helloworld.sampleclass.main(sampleclass.java:14)
  Caused by: java.lang.ClassNotFoundException: org.json.simple.JSONObject
  </code></pre>
  
  <p>I have added the following dependency also.</p>
  
  <p>Pom.xml Dependency:</p>
  
  <pre><code>&lt;dependency&gt;
     &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;
     &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
     &lt;version&gt;1.1.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The code executes perfectly when I try to run in intellij, but I am getting this error when I run with the jar. Any suggestions would be great.</p>