title: Trying to compile using JAR file in intellij-idea getting ERRORS java.lang.NoClassDefFoundError and java.lang.ClassNotFoundException
body: <p>I am using the JAR file <a href="https://github.com/TooTallNate/Java-WebSocket/releases/tag/v1.5.2" rel="nofollow noreferrer">Java-WebSocket-1.5.2.jar</a> and I followed their <a href="https://github.com/TooTallNate/Java-WebSocket/wiki#server-example" rel="nofollow noreferrer">example</a>, I am using Intellij Idea-ce and I am getting the errors:</p>
  <pre><code>/usr/lib/jvm/java-17-openjdk/bin/java -javaagent:/opt/intellij-idea-ce/lib/idea_rt.jar=35201:/opt/intellij-idea-ce/bin -Dfile.encoding=UTF-8 -classpath /home/root/my/Project/out/production/Project:/tmp/Java-WebSocket-1.5.2.jar SimpleServer
  </code></pre>
  <pre><code>Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
      at org.java_websocket.AbstractWebSocket.&lt;init&gt;(AbstractWebSocket.java:50)
      at org.java_websocket.server.WebSocketServer.&lt;init&gt;(WebSocketServer.java:208)
      at org.java_websocket.server.WebSocketServer.&lt;init&gt;(WebSocketServer.java:181)
      at org.java_websocket.server.WebSocketServer.&lt;init&gt;(WebSocketServer.java:149)
      at SimpleServer.&lt;init&gt;(SimpleServer.java:10)
      at SimpleServer.main(SimpleServer.java:49)
  </code></pre>
  <pre><code>Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
      at        java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
      ... 6 more
  </code></pre>
  <p>Since the code is exactly from their example it makes me believe it has something to do with my project setup. I tried researching these errors and everyone says to just add the JAR to the modules under the Project management, which the JAR files are there. And from the first quot of errors the JAR files is indeed in the -classpath compile command so I am unsure why I would be getting this.</p>
  <p>If anyone has any idea why this could be happening it would be greatly appreciated. I am completely lost and do not want to have to deal with Maven if I have the JAR file.</p>
  <p>Thank you for any assistance.</p>