Compile java file with two jars from command line? -


suppose have 2 jar files (with classes inside) , java file:

name1.jar name2.jar code.java 

as said @ how use classes .jar files?, if wanted import name1.jar, add classpath, , run

javac -cp '.:name1.jar' code.java 

every time wanted import name1.jar. however, how compile java code , import both jar files, not name1.jar?

try this

javac -cp name1.jar:name2.jar code.java 

note if in windows path separator should ;


Comments