Presuming you're talking about a command line invocation of javac
, what you're talking about is "can I provide libraries as arguments to javac to fulfill requirements during compilation".
Top entry for man javac
says
-classpath classpath
Sets the user class path, overriding the user class path in the
CLASSPATH environment variable. If neither CLASSPATH or -class-
path is specified, the user class path consists of the current
directory. See Setting the Class Path for more details.
Effectively I suspect you just need to say
javac -classpath path/to/library1.jar Main.java