title: How do I generate .class file if I have external Jar dependencies? Javac does not work
body: <p>Background: Running on an ec2 instance not eclipse.</p>
  
  <p>I have a java program that has external Jar dependencies. I want to create an executable jar file for this java program (being able to package the external jar files into this jar file would be icing on the cake)</p>
  
  <p>The problem is that for me to use the java cf or cmf command I need to have a .class file. But, when I try javac HKP.java it throws a bunch of errors saying "xyz does not exist or cannot recognize symbol" which I'm guessing is because it has no idea about the external jar dependencies.</p>
  
  <p>I have tried doing javac -sourcepath /home/ec2-user/apps/HKP/lib/ HKP.java, but it throws the exact same errors as before. </p>
  
  <p><strong>EDIT</strong> I have tried javac -classpath file1.jar, file2.jar, file3.jar HKP.java -I have also tried this with ";" in between. both return errors saying -bash file2.jar command not found, so instead of continuing the argument, bash is recognizing the multiple jar files as commands.This is the initial problem I had that caused me to post here.</p>
  
  <p>Any help is much appreciated. Thank you!</p>