If you're using Terminal to compile and launch your program, then in the Terminal window, begin by setting the CLASSPATH:
$ export CLASSPATH=$CLASSPATH:/Users/Michael/path/to/jar1.jar:/Users/Michael/path/to/jar2.jarThen you can type echo $CLASSPATH and see that the jars are referenced.
Now, in the same Terminal window, use javac to compile your class. Setting the CLASSPATH as above only applies to the current Terminal window and any processes launched from it.
Alternately you can pass the CLASSPATH to javac:
$ javac -cp $CLASSPATH:/Users/Michael/path/to/jar1.jar:/Users/Michael/path/to/jar2.jar MyClass.javaTo persist this CLASSPATH for future Terminal sessions, add the export line above to the file .profile in your home directory.