Suppose I have two jar files (with classes inside) and a java file:
name1.jar
name2.jar
code.java
As said at How to use classes from .jar files?, if I wanted to import name1.jar, I could add it to my CLASSPATH, and run
javac -cp '.:name1.jar' code.java
every time I wanted to import name1.jar. However, how would I compile the java code and import both jar files, not just name1.jar?