In bash, I would like to specify all .jar
files under a directory to the option -cp
of javac
(and later java
when running the compiled program).
But
$ javac -cp /home/hibernate-release-4.3.11.Final/lib/required/*.jar *.java
javac: invalid flag: /home/hibernate-release-4.3.11.Final/lib/required/dom4j-1.6.1.jar
Usage: javac <options> <source files>
use -help for a list of possible options
Is it because the expansion of *.jar
files are separated by but not
:
which is required by -cp
?
Is there a way that works without me to manually specify all the .jar
files under a directory?
Thanks.