title: Could not find or load main class Mysql
body: <p>I have problem with my java app compilation.</p>
  
  <p>Folder structure:</p>
  
  <p>src/LogServer.java (this is the main class)</p>
  
  <p>src/SocketThread.java</p>
  
  <p>I also use MySQL driver in it.
  This files aren't in package.</p>
  
  <p>When I'm running:</p>
  
  <pre><code>javac -classpath mysql-connector-java-3.1.14-bin.jar *.java
  </code></pre>
  
  <p>everything works fine.</p>
  
  <p>See the compilation:</p>
  
  <pre><code>java -classpath mysql-connector-java-3.1.14-bin.jar LogServer
  </code></pre>
  
  <p>compiler says:</p>
  
  <pre>user@user-Inspiron-3543:~/workspace/LogServer/src$ javac -classpath mysql-connector-java-3.1.14-bin.jar *.java
  
  user@user-Inspiron-3543:~/workspace/LogServer/src$ java -classpath mysql-connector-java-3.1.14-bin.jar LogServer
  Error: Could not find or load main class LogServer
  
  user@user-Inspiron-3543:~/workspace/LogServer/src$ java LogServer
  java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
      at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@9-internal/BuiltinClassLoader.java:366)
      at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@9-internal/ClassLoaders.java:184)
      at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)
      at java.lang.Class.forName0(java.base@9-internal/Native Method)
      at java.lang.Class.forName(java.base@9-internal/Class.java:294)
      at LogServer.init(LogServer.java:22)
      at LogServer.main(LogServer.java:51)
  user@user-Inspiron-3543:~/workspace/LogServer/src$ 
  </pre>