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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -