title: How to compile Java class with .jar dependencies on Linux command line
body: <p>I'm a CS Student working with my first .jar file and I'm having trouble getting my class that's dependent on it to compile. I'm using VSCode as my code editor, and I've added the .jar file to the &quot;Referenced Libraries&quot; section of my java project. The class I'm trying to run is a fairly simple class generated from our textbook, with an accompanying .jar file that has a bunch of custom libraries on it. I can see the contents of the jar in the VSCode java project browser, but when I try to compile I get import and symbol not found errors. I usually compile and run my projects in the terminal window (running Ubuntu 18.04 over Windows using WSL) by simply typing &quot;javac MyClass.java&quot;. I would expect that if the jar has been loaded into VSCode, then it should compile the same way, but that doesn't appear to be the case. I've tried the recommended syntax &quot;javac -cp /lib/myjar.jar MyClass.java&quot; and &quot;javac -jar /lib/myjar.jar MyClass.java&quot; but neither works for me.</p>
  <p>I'm fairly certain there's something simple I'm missing, as I don't have any experience working with jars, and certainly not in VSCode. Anyone out there that has an idea what I'm missing?</p>