title: Run Java single-file-source code with dependency and external library
body: <p>I would like to know how to use the command line to run the Java single-file-source code.</p>
  <p>I know that I cannot refer to outside classes per rules.</p>
  <p>But I saw an YouTube video. The author is able to use external JAR library when he runs single-file-source code.</p>
  <p>See this YouTube video @ 6:00 minute
  <a href="https://www.youtube.com/watch?v=U7Rp9hq0_Zk" rel="nofollow noreferrer">https://www.youtube.com/watch?v=U7Rp9hq0_Zk</a></p>
  <p>He types:</p>
  <p>java -cp mysql-connector-java-8.0.19.jar Database.java</p>
  <p>I don't know how the database really works. I'm not there yet.</p>
  <p>But if you guys can show me a quick example, that would be great.</p>
  <p>Thanks!</p>